CINXE.COM
<!DOCTYPE html> <html lang="" class="bc-iframe"> <head> <meta charset="utf-8"> <title></title> <meta name="viewport" content="user-scalable=0, width=device-width, maximum-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="icon" href="data:;base64,iVBORw0KGgo="> <style class="bc-style-vjs"> .vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-control:focus .vjs-svg-icon,.vjs-svg-icon:hover{filter:drop-shadow(0 0 .25em #fff)}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid #fff;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translateX(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}@supports not (inset:10px){.video-js .vjs-text-track-display>div{top:0;right:0;bottom:0;left:0}}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:rgba(50,50,50,.5);cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:rgba(50,50,50,.9)}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0} </style> <style class="bc-style-bUZeiKlfu-default"> .bc-player-bUZeiKlfu_default *,.bc-player-bUZeiKlfu_default :after,.bc-player-bUZeiKlfu_default :before{box-sizing:inherit;font-size:inherit;color:inherit;line-height:inherit}.bc-player-bUZeiKlfu_default{width:300px;height:150px;font-size:14px;overflow:hidden}.bc-player-bUZeiKlfu_default.vjs-fluid.vjs-16-9:not(.vjs-audio-only-mode),.bc-player-bUZeiKlfu_default.vjs-fluid:not(.vjs-audio-only-mode){padding-top:56.25%}.bc-player-bUZeiKlfu_default.vjs-fluid.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.bc-player-bUZeiKlfu_default.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.bc-iframe,.bc-iframe body,.bc-player-bUZeiKlfu_default,.bc-player-bUZeiKlfu_default .vjs-poster{background-color:#151b17}.bc-iframe,.bc-iframe .bc-player-bUZeiKlfu_default,.bc-iframe body{margin:0;width:100%;height:100%;overflow:hidden}.bc-player-bUZeiKlfu_default.vjs-fullscreen,.bc-player-bUZeiKlfu_default.vjs-fullscreen .vjs-tech{width:100%!important;height:100%!important}.bc-player-bUZeiKlfu_default .vjs-track-setting select{color:#000;background-color:#fff}.bc-player-bUZeiKlfu_default .vjs-audio-button .vjs-menu-item,.bc-player-bUZeiKlfu_default .vjs-chapters-button .vjs-menu-item,.bc-player-bUZeiKlfu_default .vjs-descriptions-button .vjs-menu-item,.bc-player-bUZeiKlfu_default .vjs-subs-caps-button .vjs-menu-item{text-transform:none}.bc-player-bUZeiKlfu_default.vjs-waiting-for-autoplay .vjs-big-play-button{opacity:0}.bc-player-bUZeiKlfu_default .vjs-progress-control .vjs-mouse-display{z-index:2}/*! @name @brightcove/player-core @version 2.22.0 @license UNLICENSED */.vjs-download-button{cursor:pointer}.vjs-download-button.has-icon-downloading{cursor:wait}.vjs-download-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-download-button.has-icon-file-download .vjs-icon-placeholder:before{content:"\f110"}.vjs-download-button.has-icon-downloading .vjs-icon-placeholder:before{content:"\f10f"}.vjs-download-button.has-icon-file-download-off .vjs-icon-placeholder:before{content:"\f112"}.vjs-modal-dialog.vjs-player-info-modal{background:rgba(0,0,0,.9)}.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{overflow:auto;display:grid;grid-template-columns:1fr 1fr;grid-gap:1em}@media screen and (max-width:640px){.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-modal-dialog.vjs-player-info-modal h2{font-size:1.1667em;margin:0 0 .4286em}.vjs-modal-dialog.vjs-player-info-modal table{border-bottom:1px solid #333;border-collapse:collapse;border-top:1px solid #333;margin-bottom:1.5em;width:100%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-two td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-two th{width:50%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-three td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-three th{width:33.333%}.vjs-modal-dialog.vjs-player-info-modal th{font-weight:400;text-align:left}.vjs-modal-dialog.vjs-player-info-modal td{border-bottom:1px solid #333;opacity:.5}.vjs-modal-dialog.vjs-player-info-modal tr:last-child td{border-bottom:0}.vjs-modal-dialog.vjs-player-info-modal tr:hover td{opacity:1}/*! @name videojs-contextmenu-ui @version 7.0.0 @license Apache-2.0 */.vjs-contextmenu-ui-menu{position:absolute}.vjs-contextmenu-ui-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;padding:.25em}.vjs-contextmenu-ui-menu .vjs-menu-item{border-radius:.3em;cursor:pointer;margin:0 0 1px;padding:.5em 1em;font-size:1em;line-height:1.2;text-transform:none}.vjs-contextmenu-ui-menu .vjs-menu-item:active,.vjs-contextmenu-ui-menu .vjs-menu-item:hover{background-color:rgba(0,0,0,.5);text-shadow:0 0 1em #fff}/*! @name videojs-errors @version 6.2.0 @license Apache-2.0 */.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}.vjs-errors-ref-id{color:rgba(255,255,255,.5);font-size:.75em;margin:.5em 0 0}.bc-player-bUZeiKlfu_default .vjs-control-bar{background-color:rgba(0,0,0,.6);color:#fff}.bc-player-bUZeiKlfu_default .vjs-control{color:inherit}.bc-player-bUZeiKlfu_default .vjs-mouse-display:after,.bc-player-bUZeiKlfu_default .vjs-play-progress:after{border-radius:0}.bc-player-bUZeiKlfu_default .vjs-menu-button-inline:hover,.bc-player-bUZeiKlfu_default.vjs-no-flex .vjs-menu-button-inline{width:8.35em}.bc-player-bUZeiKlfu_default .vjs-control:focus:before,.bc-player-bUZeiKlfu_default .vjs-control:hover:before{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff}.bc-player-bUZeiKlfu_default .vjs-spacer{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:1 1 auto;-moz-box-flex:1 1 auto;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.bc-player-bUZeiKlfu_default .vjs-time-control{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:0 1 auto;-moz-box-flex:0 1 auto;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;width:auto}.bc-player-bUZeiKlfu_default .vjs-time-control.vjs-time-divider{width:14px}.bc-player-bUZeiKlfu_default .vjs-time-control.vjs-time-divider div{width:100%;text-align:center}.bc-player-bUZeiKlfu_default .vjs-time-control.vjs-current-time{margin-left:1em}.bc-player-bUZeiKlfu_default .vjs-time-control .vjs-current-time-display,.bc-player-bUZeiKlfu_default .vjs-time-control .vjs-duration-display{width:100%}.bc-player-bUZeiKlfu_default .vjs-time-control .vjs-current-time-display{text-align:right}.bc-player-bUZeiKlfu_default .vjs-time-control .vjs-duration-display{text-align:left}.bc-player-bUZeiKlfu_default .vjs-remaining-time{display:none}.bc-player-bUZeiKlfu_default.vjs-no-flex .vjs-time-control.vjs-remaining-time{display:none}.bc-player-bUZeiKlfu_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-bUZeiKlfu_default .vjs-play-progress,.bc-player-bUZeiKlfu_default .vjs-volume-level{background-color:#08088c}.bc-player-bUZeiKlfu_default.vjs-ad-playing .vjs-play-progress,.bc-player-bUZeiKlfu_default.vjs-ad-playing .vjs-volume-level{background-color:#ffe400}.bc-player-bUZeiKlfu_default .vjs-play-progress:before,.bc-player-bUZeiKlfu_default .vjs-volume-level:before{display:none}.bc-player-bUZeiKlfu_default .vjs-volume-level:after{display:none}.bc-player-bUZeiKlfu_default .vjs-progress-control{position:absolute;left:0;right:0;width:100%;height:1.5em;top:-1.5em}.bc-player-bUZeiKlfu_default .vjs-progress-control .vjs-load-progress,.bc-player-bUZeiKlfu_default .vjs-progress-control .vjs-play-progress,.bc-player-bUZeiKlfu_default .vjs-progress-control .vjs-progress-holder{height:100%}.bc-player-bUZeiKlfu_default .vjs-progress-control .vjs-progress-holder{margin:0}.bc-player-bUZeiKlfu_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-bUZeiKlfu_default .vjs-control-bar:not(.vjs-focus-within){-webkit-transition:-webkit-transform .1s ease 0s;-moz-transition:-moz-transform .1s ease 0s;-ms-transition:-ms-transform .1s ease 0s;-o-transition:-o-transform .1s ease 0s;transition:transform .1s ease 0s}.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar,.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible){visibility:visible;opacity:1;-webkit-backface-visibility:hidden;-webkit-transform:translateY(3em);-moz-transform:translateY(3em);-ms-transform:translateY(3em);-o-transform:translateY(3em);transform:translateY(3em);-webkit-transition:-webkit-transform 1s ease 0s;-moz-transition:-moz-transform 1s ease 0s;-ms-transition:-ms-transform 1s ease 0s;-o-transition:-o-transform 1s ease 0s;transition:transform 1s ease 0s}.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control{height:.3em;top:-.3em;pointer-events:none;-webkit-transition:height 1s,top 1s;-moz-transition:height 1s,top 1s;-ms-transition:height 1s,top 1s;-o-transition:height 1s,top 1s;transition:height 1s,top 1s}.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-volume-vertical,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-volume-vertical,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-volume-vertical,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu-item,.bc-player-bUZeiKlfu_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-bUZeiKlfu_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu{opacity:1}.bc-player-bUZeiKlfu_default.vjs-live .vjs-live-control{margin-left:1em}.bc-player-bUZeiKlfu_default.vjs-live .vjs-time-control.vjs-current-time,.bc-player-bUZeiKlfu_default.vjs-live .vjs-time-control.vjs-duration,.bc-player-bUZeiKlfu_default.vjs-live .vjs-time-control.vjs-time-divider{display:none}.bc-player-bUZeiKlfu_default .vjs-big-play-button{top:50%;left:50%;margin-left:-1em;margin-top:-1em;width:2em;height:2em;line-height:2em;border:none;border-radius:50%;font-size:3.5em;background-color:rgba(0,0,0,.45);color:#fff;-webkit-transition:border-color .4s,outline .4s,background-color .4s;-moz-transition:border-color .4s,outline .4s,background-color .4s;-ms-transition:border-color .4s,outline .4s,background-color .4s;-o-transition:border-color .4s,outline .4s,background-color .4s;transition:border-color .4s,outline .4s,background-color .4s}.bc-player-bUZeiKlfu_default .vjs-big-play-button:active,.bc-player-bUZeiKlfu_default .vjs-big-play-button:focus,.bc-player-bUZeiKlfu_default:active .vjs-big-play-button,.bc-player-bUZeiKlfu_default:hover .vjs-big-play-button{background-color:#08088c}.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu{left:-3em}.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-content{width:12em;left:-1em;padding:.2em .5em .5em;border-radius:.25em .25em 0 0}.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item,.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-title{background-color:#151b17;margin:.3em 0;padding:.5em;border-radius:.3em}.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected{background-color:#08088c;color:#fff}.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:active,.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus,.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:hover{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff;color:#fff}.bc-player-bUZeiKlfu_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus:not(.vjs-selected){background-color:#151b17}.bc-player-bUZeiKlfu_default.vjs-ad-playing .vjs-mouse-display,.bc-player-bUZeiKlfu_default.vjs-ad-playing .vjs-mouse-display:after{display:none}.bc-player-bUZeiKlfu_default.vjs-ad-playing.vjs-ad-playing .vjs-progress-control:after{pointer-events:auto;width:100%;height:100%;position:absolute;left:0;bottom:0;content:" ";-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}.bc-player-bUZeiKlfu_default.vjs-ad-playing .vjs-picture-in-picture-control{display:none}.bc-player-bUZeiKlfu_default.vjs-no-flex .vjs-spacer{display:table-cell}.bc-player-bUZeiKlfu_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-bUZeiKlfu_default.vjs-no-flex .vjs-remaining-time{display:none}.vjs-mouse.bc-player-bUZeiKlfu_default .vjs-control-bar{font-size:10px}.vjs-mouse.bc-player-bUZeiKlfu_default .vjs-progress-control{height:.5em;top:-.5em}.vjs-mouse.bc-player-bUZeiKlfu_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-bUZeiKlfu_default select{width:inherit}.bc-player-bUZeiKlfu_default.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control,.bc-player-bUZeiKlfu_default.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control{display:block}.bc-player-bUZeiKlfu_default .vjs-title-bar{line-height:1.5;padding-top:1em}.bc-player-bUZeiKlfu_default.vjs-audio-mode.vjs-has-started.vjs-focus-within.video-js.video-js.video-js .vjs-control-bar,.bc-player-bUZeiKlfu_default.vjs-audio-mode.vjs-has-started.vjs-user-active.video-js.video-js.video-js .vjs-control-bar:not(.vjs-focus-within),.bc-player-bUZeiKlfu_default.vjs-audio-mode.vjs-has-started.vjs-user-inactive.video-js.video-js.video-js .vjs-control-bar{opacity:1;visibility:visible;transform:none}.bc-player-bUZeiKlfu_default.vjs-audio-only-mode .vjs-poster{display:none}.bc-player-bUZeiKlfu_default.vjs-audio-only-mode .vjs-progress-control{height:1.5em;top:-1.5em}.vjs-bumper-video .vjs-play-progress.vjs-play-progress-resetting{transition:width 0s linear}.vjs-bumper-video .vjs-dock-text{display:none} </style> </head> <body><video-js data-account="665001591001" data-player="bUZeiKlfu" data-embed="default" data-application-id="" class="video-js vjs-default-skin" > </video-js> <script>(function(p){p.mark&&p.mark('bcParseStart')})(window.performance||{})</script> <script>(function(){var e=function e(t){return Boolean(t.IE_VERSION)};var t;try{t=function(Ly,Ny){var i=undefined;var e=Ly.define;var t=Ly.videojs;Ly.VIDEOJS_NO_DYNAMIC_STYLE=true;var s=function(){"use strict";var t=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof Ly!=="undefined"?Ly:{};var c=[];var u=[];var E=typeof Uint8Array!=="undefined"?Uint8Array:Array;var I=false;function C(){I=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,i=e.length;t<i;++t){c[t]=e[t];u[e.charCodeAt(t)]=t}u["-".charCodeAt(0)]=62;u["_".charCodeAt(0)]=63}function i(e){if(!I){C()}var t,i,s,n,r,a;var o=e.length;if(o%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}r=e[o-2]==="="?2:e[o-1]==="="?1:0;a=new E(o*3/4-r);s=r>0?o-4:o;var l=0;for(t=0,i=0;t<s;t+=4,i+=3){n=u[e.charCodeAt(t)]<<18|u[e.charCodeAt(t+1)]<<12|u[e.charCodeAt(t+2)]<<6|u[e.charCodeAt(t+3)];a[l++]=n>>16&255;a[l++]=n>>8&255;a[l++]=n&255}if(r===2){n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4;a[l++]=n&255}else if(r===1){n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2;a[l++]=n>>8&255;a[l++]=n&255}return a}function M(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[e&63]}function U(e,t,i){var s;var n=[];for(var r=t;r<i;r+=3){s=(e[r]<<16)+(e[r+1]<<8)+e[r+2];n.push(M(s))}return n.join("")}function B(e){if(!I){C()}var t;var i=e.length;var s=i%3;var n="";var r=[];var a=16383;for(var o=0,l=i-s;o<l;o+=a){r.push(U(e,o,o+a>l?l:o+a))}if(s===1){t=e[i-1];n+=c[t>>2];n+=c[t<<4&63];n+="=="}else if(s===2){t=(e[i-2]<<8)+e[i-1];n+=c[t>>10];n+=c[t>>4&63];n+=c[t<<2&63];n+="="}r.push(n);return r.join("")}function F(e,t,i,s,n){var r,a;var o=n*8-s-1;var l=(1<<o)-1;var c=l>>1;var u=-7;var d=i?n-1:0;var h=i?-1:1;var f=e[t+d];d+=h;r=f&(1<<-u)-1;f>>=-u;u+=o;for(;u>0;r=r*256+e[t+d],d+=h,u-=8){}a=r&(1<<-u)-1;r>>=-u;u+=s;for(;u>0;a=a*256+e[t+d],d+=h,u-=8){}if(r===0){r=1-c}else if(r===l){return a?NaN:(f?-1:1)*Infinity}else{a=a+Math.pow(2,s);r=r-c}return(f?-1:1)*a*Math.pow(2,r-s)}function q(e,t,i,s,n,r){var a,o,l;var c=r*8-n-1;var u=(1<<c)-1;var d=u>>1;var h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var f=s?0:r-1;var p=s?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=u}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(l=Math.pow(2,-a))<1){a--;l*=2}if(a+d>=1){t+=h/l}else{t+=h*Math.pow(2,1-d)}if(t*l>=2){a++;l/=2}if(a+d>=u){o=0;a=u}else if(a+d>=1){o=(t*l-1)*Math.pow(2,n);a=a+d}else{o=t*Math.pow(2,d-1)*Math.pow(2,n);a=0}}for(;n>=8;e[i+f]=o&255,f+=p,o/=256,n-=8){}a=a<<n|o;c+=n;for(;c>0;e[i+f]=a&255,f+=p,a/=256,c-=8){}e[i+f-p]|=m*128}var j={}.toString;var V=Array.isArray||function(e){return j.call(e)=="[object Array]"};var $=50;Py.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:true;H();function H(){return Py.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(H()<t){throw new RangeError("Invalid typed array length")}if(Py.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=Py.prototype}else{if(e===null){e=new Py(t)}e.length=t}return e}function Py(e,t,i){if(!Py.TYPED_ARRAY_SUPPORT&&!(this instanceof Py)){return new Py(e,t,i)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return Q(this,e)}return G(this,e,t,i)}Py.poolSize=8192;Py._augment=function(e){e.__proto__=Py.prototype;return e};function G(e,t,i,s){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return ee(e,t,i,s)}if(typeof t==="string"){return J(e,t,i)}return te(e,t)}Py.from=function(e,t,i){return G(null,e,t,i)};if(Py.TYPED_ARRAY_SUPPORT){Py.prototype.__proto__=Uint8Array.prototype;Py.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&Py[Symbol.species]===Py);}function z(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function K(e,t,i,s){z(t);if(t<=0){return r(e,t)}if(i!==undefined){return typeof s==="string"?r(e,t).fill(i,s):r(e,t).fill(i)}return r(e,t)}Py.alloc=function(e,t,i){return K(null,e,t,i)};function Q(e,t){z(t);e=r(e,t<0?0:ie(t)|0);if(!Py.TYPED_ARRAY_SUPPORT){for(var i=0;i<t;++i){e[i]=0}}return e}Py.allocUnsafe=function(e){return Q(null,e)};Py.allocUnsafeSlow=function(e){return Q(null,e)};function J(e,t,i){if(typeof i!=="string"||i===""){i="utf8"}if(!Py.isEncoding(i)){throw new TypeError('"encoding" must be a valid string encoding')}var s=se(t,i)|0;e=r(e,s);var n=e.write(t,i);if(n!==s){e=e.slice(0,n)}return e}function Z(e,t){var i=t.length<0?0:ie(t.length)|0;e=r(e,i);for(var s=0;s<i;s+=1){e[s]=t[s]&255}return e}function ee(e,t,i,s){t.byteLength;if(i<0||t.byteLength<i){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<i+(s||0)){throw new RangeError("'length' is out of bounds")}if(i===undefined&&s===undefined){t=new Uint8Array(t)}else if(s===undefined){t=new Uint8Array(t,i)}else{t=new Uint8Array(t,i,s)}if(Py.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=Py.prototype}else{e=Z(e,t)}return e}function te(e,t){if(h(t)){var i=ie(t.length)|0;e=r(e,i);if(e.length===0){return e}t.copy(e,0,0,i);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||Ne(t.length)){return r(e,0)}return Z(e,t)}if(t.type==="Buffer"&&V(t.data)){return Z(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ie(e){if(e>=H()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+H().toString(16)+" bytes")}return e|0}Py.isBuffer=Me;function h(e){return!!(e!=null&&e._isBuffer)}Py.compare=function e(t,i){if(!h(t)||!h(i)){throw new TypeError("Arguments must be Buffers")}if(t===i)return 0;var s=t.length;var n=i.length;for(var r=0,a=Math.min(s,n);r<a;++r){if(t[r]!==i[r]){s=t[r];n=i[r];break}}if(s<n)return-1;if(n<s)return 1;return 0};Py.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Py.concat=function e(t,i){if(!V(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return Py.alloc(0)}var s;if(i===undefined){i=0;for(s=0;s<t.length;++s){i+=t[s].length}}var n=Py.allocUnsafe(i);var r=0;for(s=0;s<t.length;++s){var a=t[s];if(!h(a)){throw new TypeError('"list" argument must be an Array of Buffers')}a.copy(n,r);r+=a.length}return n};function se(e,t){if(h(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var i=e.length;if(i===0)return 0;var s=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case undefined:return xe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Re(e).length;default:if(s)return xe(e).length;t=(""+t).toLowerCase();s=true}}}Py.byteLength=se;function ne(e,t,i){var s=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(i===undefined||i>this.length){i=this.length}if(i<=0){return""}i>>>=0;t>>>=0;if(i<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return ve(this,t,i);case"utf8":case"utf-8":return pe(this,t,i);case"ascii":return ye(this,t,i);case"latin1":case"binary":return _e(this,t,i);case"base64":return fe(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be(this,t,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();s=true}}}Py.prototype._isBuffer=true;function s(e,t,i){var s=e[t];e[t]=e[i];e[i]=s}Py.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;i<t;i+=2){s(this,i,i+1)}return this};Py.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var i=0;i<t;i+=4){s(this,i,i+3);s(this,i+1,i+2)}return this};Py.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var i=0;i<t;i+=8){s(this,i,i+7);s(this,i+1,i+6);s(this,i+2,i+5);s(this,i+3,i+4)}return this};Py.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return pe(this,0,t);return ne.apply(this,arguments)};Py.prototype.equals=function e(t){if(!h(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return Py.compare(this,t)===0};Py.prototype.inspect=function e(){var t="";var i=$;if(this.length>0){t=this.toString("hex",0,i).match(/.{2}/g).join(" ");if(this.length>i)t+=" ... "}return"<Buffer "+t+">"};Py.prototype.compare=function e(t,i,s,n,r){if(!h(t)){throw new TypeError("Argument must be a Buffer")}if(i===undefined){i=0}if(s===undefined){s=t?t.length:0}if(n===undefined){n=0}if(r===undefined){r=this.length}if(i<0||s>t.length||n<0||r>this.length){throw new RangeError("out of range index")}if(n>=r&&i>=s){return 0}if(n>=r){return-1}if(i>=s){return 1}i>>>=0;s>>>=0;n>>>=0;r>>>=0;if(this===t)return 0;var a=r-n;var o=s-i;var l=Math.min(a,o);var c=this.slice(n,r);var u=t.slice(i,s);for(var d=0;d<l;++d){if(c[d]!==u[d]){a=c[d];o=u[d];break}}if(a<o)return-1;if(o<a)return 1;return 0};function re(e,t,i,s,n){if(e.length===0)return-1;if(typeof i==="string"){s=i;i=0}else if(i>2147483647){i=2147483647}else if(i<-2147483648){i=-2147483648}i=+i;if(isNaN(i)){i=n?0:e.length-1}if(i<0)i=e.length+i;if(i>=e.length){if(n)return-1;else i=e.length-1}else if(i<0){if(n)i=0;else return-1}if(typeof t==="string"){t=Py.from(t,s)}if(h(t)){if(t.length===0){return-1}return ae(e,t,i,s,n)}else if(typeof t==="number"){t=t&255;if(Py.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(e,t,i)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,i)}}return ae(e,[t],i,s,n)}throw new TypeError("val must be string, number or Buffer")}function ae(e,t,i,s,n){var r=1;var a=e.length;var o=t.length;if(s!==undefined){s=String(s).toLowerCase();if(s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le"){if(e.length<2||t.length<2){return-1}r=2;a/=2;o/=2;i/=2}}function l(e,t){if(r===1){return e[t]}else{return e.readUInt16BE(t*r)}}var c;if(n){var u=-1;for(c=i;c<a;c++){if(l(e,c)===l(t,u===-1?0:c-u)){if(u===-1)u=c;if(c-u+1===o)return u*r}else{if(u!==-1)c-=c-u;u=-1}}}else{if(i+o>a)i=a-o;for(c=i;c>=0;c--){var d=true;for(var h=0;h<o;h++){if(l(e,c+h)!==l(t,h)){d=false;break}}if(d)return c}}return-1}Py.prototype.includes=function e(t,i,s){return this.indexOf(t,i,s)!==-1};Py.prototype.indexOf=function e(t,i,s){return re(this,t,i,s,true)};Py.prototype.lastIndexOf=function e(t,i,s){return re(this,t,i,s,false)};function oe(e,t,i,s){i=Number(i)||0;var n=e.length-i;if(!s){s=n}else{s=Number(s);if(s>n){s=n}}var r=t.length;if(r%2!==0)throw new TypeError("Invalid hex string");if(s>r/2){s=r/2}for(var a=0;a<s;++a){var o=parseInt(t.substr(a*2,2),16);if(isNaN(o))return a;e[i+a]=o}return a}function le(e,t,i,s){return Le(xe(t,e.length-i),e,i,s)}function ce(e,t,i,s){return Le(Oe(t),e,i,s)}function ue(e,t,i,s){return ce(e,t,i,s)}function de(e,t,i,s){return Le(Re(t),e,i,s)}function he(e,t,i,s){return Le(Pe(t,e.length-i),e,i,s)}Py.prototype.write=function e(t,i,s,n){if(i===undefined){n="utf8";s=this.length;i=0}else if(s===undefined&&typeof i==="string"){n=i;s=this.length;i=0}else if(isFinite(i)){i=i|0;if(isFinite(s)){s=s|0;if(n===undefined)n="utf8"}else{n=s;s=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var r=this.length-i;if(s===undefined||s>r)s=r;if(t.length>0&&(s<0||i<0)||i>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var a=false;for(;;){switch(n){case"hex":return oe(this,t,i,s);case"utf8":case"utf-8":return le(this,t,i,s);case"ascii":return ce(this,t,i,s);case"latin1":case"binary":return ue(this,t,i,s);case"base64":return de(this,t,i,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,t,i,s);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();a=true}}};Py.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fe(e,t,i){if(t===0&&i===e.length){return B(e)}else{return B(e.slice(t,i))}}function pe(e,t,i){i=Math.min(e.length,i);var s=[];var n=t;while(n<i){var r=e[n];var a=null;var o=r>239?4:r>223?3:r>191?2:1;if(n+o<=i){var l,c,u,d;switch(o){case 1:if(r<128){a=r}break;case 2:l=e[n+1];if((l&192)===128){d=(r&31)<<6|l&63;if(d>127){a=d}}break;case 3:l=e[n+1];c=e[n+2];if((l&192)===128&&(c&192)===128){d=(r&15)<<12|(l&63)<<6|c&63;if(d>2047&&(d<55296||d>57343)){a=d}}break;case 4:l=e[n+1];c=e[n+2];u=e[n+3];if((l&192)===128&&(c&192)===128&&(u&192)===128){d=(r&15)<<18|(l&63)<<12|(c&63)<<6|u&63;if(d>65535&&d<1114112){a=d}}}}if(a===null){a=65533;o=1}else if(a>65535){a-=65536;s.push(a>>>10&1023|55296);a=56320|a&1023}s.push(a);n+=o}return ge(s)}var me=4096;function ge(e){var t=e.length;if(t<=me){return String.fromCharCode.apply(String,e)}var i="";var s=0;while(s<t){i+=String.fromCharCode.apply(String,e.slice(s,s+=me))}return i}function ye(e,t,i){var s="";i=Math.min(e.length,i);for(var n=t;n<i;++n){s+=String.fromCharCode(e[n]&127)}return s}function _e(e,t,i){var s="";i=Math.min(e.length,i);for(var n=t;n<i;++n){s+=String.fromCharCode(e[n])}return s}function ve(e,t,i){var s=e.length;if(!t||t<0)t=0;if(!i||i<0||i>s)i=s;var n="";for(var r=t;r<i;++r){n+=De(e[r])}return n}function be(e,t,i){var s=e.slice(t,i);var n="";for(var r=0;r<s.length;r+=2){n+=String.fromCharCode(s[r]+s[r+1]*256)}return n}Py.prototype.slice=function e(t,i){var s=this.length;t=~~t;i=i===undefined?s:~~i;if(t<0){t+=s;if(t<0)t=0}else if(t>s){t=s}if(i<0){i+=s;if(i<0)i=0}else if(i>s){i=s}if(i<t)i=t;var n;if(Py.TYPED_ARRAY_SUPPORT){n=this.subarray(t,i);n.__proto__=Py.prototype}else{var r=i-t;n=new Py(r,undefined);for(var a=0;a<r;++a){n[a]=this[a+t]}}return n};function o(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}Py.prototype.readUIntLE=function e(t,i,s){t=t|0;i=i|0;if(!s)o(t,i,this.length);var n=this[t];var r=1;var a=0;while(++a<i&&(r*=256)){n+=this[t+a]*r}return n};Py.prototype.readUIntBE=function e(t,i,s){t=t|0;i=i|0;if(!s){o(t,i,this.length)}var n=this[t+--i];var r=1;while(i>0&&(r*=256)){n+=this[t+--i]*r}return n};Py.prototype.readUInt8=function e(t,i){if(!i)o(t,1,this.length);return this[t]};Py.prototype.readUInt16LE=function e(t,i){if(!i)o(t,2,this.length);return this[t]|this[t+1]<<8};Py.prototype.readUInt16BE=function e(t,i){if(!i)o(t,2,this.length);return this[t]<<8|this[t+1]};Py.prototype.readUInt32LE=function e(t,i){if(!i)o(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Py.prototype.readUInt32BE=function e(t,i){if(!i)o(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Py.prototype.readIntLE=function e(t,i,s){t=t|0;i=i|0;if(!s)o(t,i,this.length);var n=this[t];var r=1;var a=0;while(++a<i&&(r*=256)){n+=this[t+a]*r}r*=128;if(n>=r)n-=Math.pow(2,8*i);return n};Py.prototype.readIntBE=function e(t,i,s){t=t|0;i=i|0;if(!s)o(t,i,this.length);var n=i;var r=1;var a=this[t+--n];while(n>0&&(r*=256)){a+=this[t+--n]*r}r*=128;if(a>=r)a-=Math.pow(2,8*i);return a};Py.prototype.readInt8=function e(t,i){if(!i)o(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Py.prototype.readInt16LE=function e(t,i){if(!i)o(t,2,this.length);var s=this[t]|this[t+1]<<8;return s&32768?s|4294901760:s};Py.prototype.readInt16BE=function e(t,i){if(!i)o(t,2,this.length);var s=this[t+1]|this[t]<<8;return s&32768?s|4294901760:s};Py.prototype.readInt32LE=function e(t,i){if(!i)o(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Py.prototype.readInt32BE=function e(t,i){if(!i)o(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Py.prototype.readFloatLE=function e(t,i){if(!i)o(t,4,this.length);return F(this,t,true,23,4)};Py.prototype.readFloatBE=function e(t,i){if(!i)o(t,4,this.length);return F(this,t,false,23,4)};Py.prototype.readDoubleLE=function e(t,i){if(!i)o(t,8,this.length);return F(this,t,true,52,8)};Py.prototype.readDoubleBE=function e(t,i){if(!i)o(t,8,this.length);return F(this,t,false,52,8)};function d(e,t,i,s,n,r){if(!h(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<r)throw new RangeError('"value" argument is out of bounds');if(i+s>e.length)throw new RangeError("Index out of range")}Py.prototype.writeUIntLE=function e(t,i,s,n){t=+t;i=i|0;s=s|0;if(!n){var r=Math.pow(2,8*s)-1;d(this,t,i,s,r,0)}var a=1;var o=0;this[i]=t&255;while(++o<s&&(a*=256)){this[i+o]=t/a&255}return i+s};Py.prototype.writeUIntBE=function e(t,i,s,n){t=+t;i=i|0;s=s|0;if(!n){var r=Math.pow(2,8*s)-1;d(this,t,i,s,r,0)}var a=s-1;var o=1;this[i+a]=t&255;while(--a>=0&&(o*=256)){this[i+a]=t/o&255}return i+s};Py.prototype.writeUInt8=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,1,255,0);if(!Py.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[i]=t&255;return i+1};function Te(e,t,i,s){if(t<0)t=65535+t+1;for(var n=0,r=Math.min(e.length-i,2);n<r;++n){e[i+n]=(t&255<<8*(s?n:1-n))>>>(s?n:1-n)*8}}Py.prototype.writeUInt16LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,65535,0);if(Py.TYPED_ARRAY_SUPPORT){this[i]=t&255;this[i+1]=t>>>8}else{Te(this,t,i,true)}return i+2};Py.prototype.writeUInt16BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,65535,0);if(Py.TYPED_ARRAY_SUPPORT){this[i]=t>>>8;this[i+1]=t&255}else{Te(this,t,i,false)}return i+2};function Se(e,t,i,s){if(t<0)t=4294967295+t+1;for(var n=0,r=Math.min(e.length-i,4);n<r;++n){e[i+n]=t>>>(s?n:3-n)*8&255}}Py.prototype.writeUInt32LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,4294967295,0);if(Py.TYPED_ARRAY_SUPPORT){this[i+3]=t>>>24;this[i+2]=t>>>16;this[i+1]=t>>>8;this[i]=t&255}else{Se(this,t,i,true)}return i+4};Py.prototype.writeUInt32BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,4294967295,0);if(Py.TYPED_ARRAY_SUPPORT){this[i]=t>>>24;this[i+1]=t>>>16;this[i+2]=t>>>8;this[i+3]=t&255}else{Se(this,t,i,false)}return i+4};Py.prototype.writeIntLE=function e(t,i,s,n){t=+t;i=i|0;if(!n){var r=Math.pow(2,8*s-1);d(this,t,i,s,r-1,-r)}var a=0;var o=1;var l=0;this[i]=t&255;while(++a<s&&(o*=256)){if(t<0&&l===0&&this[i+a-1]!==0){l=1}this[i+a]=(t/o>>0)-l&255}return i+s};Py.prototype.writeIntBE=function e(t,i,s,n){t=+t;i=i|0;if(!n){var r=Math.pow(2,8*s-1);d(this,t,i,s,r-1,-r)}var a=s-1;var o=1;var l=0;this[i+a]=t&255;while(--a>=0&&(o*=256)){if(t<0&&l===0&&this[i+a+1]!==0){l=1}this[i+a]=(t/o>>0)-l&255}return i+s};Py.prototype.writeInt8=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,1,127,-128);if(!Py.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[i]=t&255;return i+1};Py.prototype.writeInt16LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,32767,-32768);if(Py.TYPED_ARRAY_SUPPORT){this[i]=t&255;this[i+1]=t>>>8}else{Te(this,t,i,true)}return i+2};Py.prototype.writeInt16BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,32767,-32768);if(Py.TYPED_ARRAY_SUPPORT){this[i]=t>>>8;this[i+1]=t&255}else{Te(this,t,i,false)}return i+2};Py.prototype.writeInt32LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,2147483647,-2147483648);if(Py.TYPED_ARRAY_SUPPORT){this[i]=t&255;this[i+1]=t>>>8;this[i+2]=t>>>16;this[i+3]=t>>>24}else{Se(this,t,i,true)}return i+4};Py.prototype.writeInt32BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Py.TYPED_ARRAY_SUPPORT){this[i]=t>>>24;this[i+1]=t>>>16;this[i+2]=t>>>8;this[i+3]=t&255}else{Se(this,t,i,false)}return i+4};function Ee(e,t,i,s,n,r){if(i+s>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function we(e,t,i,s,n){if(!n){Ee(e,t,i,4)}q(e,t,i,s,23,4);return i+4}Py.prototype.writeFloatLE=function e(t,i,s){return we(this,t,i,true,s)};Py.prototype.writeFloatBE=function e(t,i,s){return we(this,t,i,false,s)};function Ie(e,t,i,s,n){if(!n){Ee(e,t,i,8)}q(e,t,i,s,52,8);return i+8}Py.prototype.writeDoubleLE=function e(t,i,s){return Ie(this,t,i,true,s)};Py.prototype.writeDoubleBE=function e(t,i,s){return Ie(this,t,i,false,s)};Py.prototype.copy=function e(t,i,s,n){if(!s)s=0;if(!n&&n!==0)n=this.length;if(i>=t.length)i=t.length;if(!i)i=0;if(n>0&&n<s)n=s;if(n===s)return 0;if(t.length===0||this.length===0)return 0;if(i<0){throw new RangeError("targetStart out of bounds")}if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(t.length-i<n-s){n=t.length-i+s}var r=n-s;var a;if(this===t&&s<i&&i<n){for(a=r-1;a>=0;--a){t[a+i]=this[a+s]}}else if(r<1e3||!Py.TYPED_ARRAY_SUPPORT){for(a=0;a<r;++a){t[a+i]=this[a+s]}}else{Uint8Array.prototype.set.call(t,this.subarray(s,s+r),i)}return r};Py.prototype.fill=function e(t,i,s,n){if(typeof t==="string"){if(typeof i==="string"){n=i;i=0;s=this.length}else if(typeof s==="string"){n=s;s=this.length}if(t.length===1){var r=t.charCodeAt(0);if(r<256){t=r}}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!Py.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}}else if(typeof t==="number"){t=t&255}if(i<0||this.length<i||this.length<s){throw new RangeError("Out of range index")}if(s<=i){return this}i=i>>>0;s=s===undefined?this.length:s>>>0;if(!t)t=0;var a;if(typeof t==="number"){for(a=i;a<s;++a){this[a]=t}}else{var o=h(t)?t:xe(new Py(t,n).toString());var l=o.length;for(a=0;a<s-i;++a){this[a+i]=o[a%l]}}return this};var Ce=/[^+\/0-9A-Za-z-_]/g;function ke(e){e=Ae(e).replace(Ce,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function Ae(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function De(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function xe(e,t){t=t||Infinity;var i;var s=e.length;var n=null;var r=[];for(var a=0;a<s;++a){i=e.charCodeAt(a);if(i>55295&&i<57344){if(!n){if(i>56319){if((t-=3)>-1)r.push(239,191,189);continue}else if(a+1===s){if((t-=3)>-1)r.push(239,191,189);continue}n=i;continue}if(i<56320){if((t-=3)>-1)r.push(239,191,189);n=i;continue}i=(n-55296<<10|i-56320)+65536}else if(n){if((t-=3)>-1)r.push(239,191,189)}n=null;if(i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else{throw new Error("Invalid code point")}}return r}function Oe(e){var t=[];for(var i=0;i<e.length;++i){t.push(e.charCodeAt(i)&255)}return t}function Pe(e,t){var i,s,n;var r=[];for(var a=0;a<e.length;++a){if((t-=2)<0)break;i=e.charCodeAt(a);s=i>>8;n=i%256;r.push(n);r.push(s)}return r}function Re(e){return i(ke(e))}function Le(e,t,i,s){for(var n=0;n<s;++n){if(n+i>=t.length||n>=e.length)break;t[n+i]=e[n]}return n}function Ne(e){return e!==e}function Me(e){return e!=null&&(!!e._isBuffer||Ue(e)||Be(e))}function Ue(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function Be(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&Ue(e.slice(0,0))}var Ry=typeof globalThis!=="undefined"?globalThis:typeof Ly!=="undefined"?Ly:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function Fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var qe={exports:{}};(function(i,e){(function(e,t){i.exports=t()})(Ry,function(){var U="8.17.4";const B={};const F=function(e,t){B[e]=B[e]||[];if(t){B[e]=B[e].concat(t)}return B[e]};const i=function(e,t){F(e,t)};const q=function(e,t){const i=F(e).indexOf(t);if(i<=-1){return false}B[e]=B[e].slice();B[e].splice(i,1);return true};const j=function(s,e){F(s,[].concat(e).map(t=>{const i=(...e)=>{q(s,i);return t(...e)};return i}))};const V={prefixed:true};const $=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]];const H=$[0];let G;for(let e=0;e<$.length;e++){if($[e][1]in Ny){G=$[e];break}}if(G){for(let e=0;e<G.length;e++){V[H[e]]=G[e]}V.prefixed=G[0]!==H[0]}let u=[];const z=(o,l,c)=>(e,t,i)=>{const s=l.levels[t];const n=new RegExp(`^(${s})$`);let r=o;if(e!=="log"){i.unshift(e.toUpperCase()+":")}if(c){r=`%c${o}`;i.unshift(c)}i.unshift(r+":");if(u){u.push([].concat(i));const e=u.length-1e3;u.splice(0,e>0?e:0)}if(!Ly.console){return}let a=Ly.console[e];if(!a&&e==="debug"){a=Ly.console.info||Ly.console.log}if(!a||!s||!n.test(e)){return}a[Array.isArray(i)?"apply":"call"](Ly.console,i)};function W(a,o=":",l=""){let t="info";let i;function s(...e){i("log",t,e)}i=z(a,s,l);s.createLogger=(e,t,i)=>{const s=t!==undefined?t:o;const n=i!==undefined?i:l;const r=`${a} ${s} ${e}`;return W(r,s,n)};s.createNewLogger=(e,t,i)=>{return W(e,t,i)};s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t};s.level=e=>{if(typeof e==="string"){if(!s.levels.hasOwnProperty(e)){throw new Error(`"${e}" in not a valid log level`)}t=e}return t};s.history=()=>u?[].concat(u):[];s.history.filter=t=>{return(u||[]).filter(e=>{return new RegExp(`.*${t}.*`).test(e[0])})};s.history.clear=()=>{if(u){u.length=0}};s.history.disable=()=>{if(u!==null){u.length=0;u=null}};s.history.enable=()=>{if(u===null){u=[]}};s.error=(...e)=>i("error",t,e);s.warn=(...e)=>i("warn",t,e);s.debug=(...e)=>i("debug",t,e);return s}const d=W("VIDEOJS");const Y=d.createLogger;const X=Object.prototype.toString;const K=function(e){return Z(e)?Object.keys(e):[]};function Q(t,i){K(t).forEach(e=>i(t[e],e))}function J(i,s,e=0){return K(i).reduce((e,t)=>s(e,i[t],t),e)}function Z(e){return!!e&&typeof e==="object"}function ee(e){return Z(e)&&X.call(e)==="[object Object]"&&e.constructor===Object}function h(...e){const i={};e.forEach(e=>{if(!e){return}Q(e,(e,t)=>{if(!ee(e)){i[t]=e;return}if(!ee(i[t])){i[t]={}}i[t]=h(i[t],e)})});return i}function te(e={}){const t=[];for(const i in e){if(e.hasOwnProperty(i)){const s=e[i];t.push(s)}}return t}function ie(t,i,s,e=true){const n=e=>Object.defineProperty(t,i,{value:e,enumerable:true,writable:true});const r={configurable:true,enumerable:true,get(){const e=s();n(e);return e}};if(e){r.set=n}return Object.defineProperty(t,i,r)}var se=Object.freeze({__proto__:null,each:Q,reduce:J,isObject:Z,isPlain:ee,merge:h,values:te,defineLazyProperty:ie});let ne=false;let re=null;let ae=false;let oe;let le=false;let ce=false;let ue=false;let de=false;let he=null;let fe=null;const pe=Boolean(Ly.cast&&Ly.cast.framework&&Ly.cast.framework.CastReceiverContext);let me=null;let ge=false;let ye=false;let _e=false;let ve=false;let be=false;let Te=false;let Se=false;const Ee=Boolean(De()&&("ontouchstart"in Ly||Ly.navigator.maxTouchPoints||Ly.DocumentTouch&&Ly.document instanceof Ly.DocumentTouch));const we=Ly.navigator&&Ly.navigator.userAgentData;if(we&&we.platform&&we.brands){ae=we.platform==="Android";ce=Boolean(we.brands.find(e=>e.brand==="Microsoft Edge"));ue=Boolean(we.brands.find(e=>e.brand==="Chromium"));de=!ce&&ue;he=fe=(we.brands.find(e=>e.brand==="Chromium")||{}).version||null;ye=we.platform==="Windows"}if(!ue){const N=Ly.navigator&&Ly.navigator.userAgent||"";ne=/iPod/i.test(N);re=function(){const e=N.match(/OS (\d+)_/i);if(e&&e[1]){return e[1]}return null}();ae=/Android/i.test(N);oe=function(){const e=N.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e){return null}const t=e[1]&&parseFloat(e[1]);const i=e[2]&&parseFloat(e[2]);if(t&&i){return parseFloat(e[1]+"."+e[2])}else if(t){return t}return null}();le=/Firefox/i.test(N);ce=/Edg/i.test(N);ue=/Chrome/i.test(N)||/CriOS/i.test(N);de=!ce&&ue;he=fe=function(){const e=N.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}();me=function(){const e=/MSIE\s(\d+)\.\d/.exec(N);let t=e&&parseFloat(e[1]);if(!t&&/Trident\/7.0/i.test(N)&&/rv:11.0/.test(N)){t=11}return t}();be=/Tizen/i.test(N);Te=/Web0S/i.test(N);Se=be||Te;ge=/Safari/i.test(N)&&!de&&!ae&&!ce&&!Se;ye=/Windows/i.test(N);_e=/iPad/i.test(N)||ge&&Ee&&!/iPhone/i.test(N);ve=/iPhone/i.test(N)&&!_e}const f=ve||_e||ne;const Ie=(ge||f)&&!de;var Ce=Object.freeze({__proto__:null,get IS_IPOD(){return ne},get IOS_VERSION(){return re},get IS_ANDROID(){return ae},get ANDROID_VERSION(){return oe},get IS_FIREFOX(){return le},get IS_EDGE(){return ce},get IS_CHROMIUM(){return ue},get IS_CHROME(){return de},get CHROMIUM_VERSION(){return he},get CHROME_VERSION(){return fe},IS_CHROMECAST_RECEIVER:pe,get IE_VERSION(){return me},get IS_SAFARI(){return ge},get IS_WINDOWS(){return ye},get IS_IPAD(){return _e},get IS_IPHONE(){return ve},get IS_TIZEN(){return be},get IS_WEBOS(){return Te},get IS_SMART_TV(){return Se},TOUCH_ENABLED:Ee,IS_IOS:f,IS_ANY_SAFARI:Ie});function ke(e){return typeof e==="string"&&Boolean(e.trim())}function Ae(e){if(e.indexOf(" ")>=0){throw new Error("class has illegal whitespace characters")}}function De(){return Ny===Ly.document}function xe(e){return Z(e)&&e.nodeType===1}function Oe(){try{return Ly.parent!==Ly.self}catch(e){return true}}function Pe(s){return function(e,t){if(!ke(e)){return Ny[s](null)}if(ke(t)){t=Ny.querySelector(t)}const i=xe(t)?t:Ny;return i[s]&&i[s](e)}}function p(e="div",i={},t={},s){const n=Ny.createElement(e);Object.getOwnPropertyNames(i).forEach(function(e){const t=i[e];if(e==="textContent"){Re(n,t)}else if(n[e]!==t||e==="tabIndex"){n[e]=t}});Object.getOwnPropertyNames(t).forEach(function(e){n.setAttribute(e,t[e])});if(s){Je(n,s)}return n}function Re(e,t){if(typeof e.textContent==="undefined"){e.innerText=t}else{e.textContent=t}return e}function Le(e,t){if(t.firstChild){t.insertBefore(e,t.firstChild)}else{t.appendChild(e)}}function Ne(e,t){Ae(t);return e.classList.contains(t)}function Me(e,...t){e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function Ue(e,...t){if(!e){d.warn("removeClass was called with an element that doesn't exist");return null}e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function Be(t,e,i){if(typeof i==="function"){i=i(t,e)}if(typeof i!=="boolean"){i=undefined}e.split(/\s+/).forEach(e=>t.classList.toggle(e,i));return t}function Fe(i,s){Object.getOwnPropertyNames(s).forEach(function(e){const t=s[e];if(t===null||typeof t==="undefined"||t===false){i.removeAttribute(e)}else{i.setAttribute(e,t===true?"":t)}})}function qe(e){const i={};const s=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let t=n.length-1;t>=0;t--){const r=n[t].name;let e=n[t].value;if(s.includes(r)){e=e!==null?true:false}i[r]=e}}return i}function je(e,t){return e.getAttribute(t)}function Ve(e,t,i){e.setAttribute(t,i)}function $e(e,t){e.removeAttribute(t)}function He(){Ny.body.focus();Ny.onselectstart=function(){return false}}function Ge(){Ny.onselectstart=function(){return true}}function ze(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect();const i={};["bottom","height","left","right","top","width"].forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});if(!i.height){i.height=parseFloat(st(e,"height"))}if(!i.width){i.width=parseFloat(st(e,"width"))}return i}}function We(e){if(!e||e&&!e.offsetParent){return{left:0,top:0,width:0,height:0}}const t=e.offsetWidth;const i=e.offsetHeight;let s=0;let n=0;while(e.offsetParent&&e!==Ny[V.fullscreenElement]){s+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}return{left:s,top:n,width:t,height:i}}function Ye(t,e){const i={x:0,y:0};if(f){let e=t;while(e&&e.nodeName.toLowerCase()!=="html"){const t=st(e,"transform");if(/^matrix/.test(t)){const e=t.slice(7,-1).split(/,\s/).map(Number);i.x+=e[4];i.y+=e[5]}else if(/^matrix3d/.test(t)){const e=t.slice(9,-1).split(/,\s/).map(Number);i.x+=e[12];i.y+=e[13]}if(e.assignedSlot&&e.assignedSlot.parentElement&&Ly.WebKitCSSMatrix){const u=Ly.getComputedStyle(e.assignedSlot.parentElement).transform;const d=new Ly.WebKitCSSMatrix(u);i.x+=d.m41;i.y+=d.m42}e=e.parentNode||e.host}}const s={};const n=We(e.target);const r=We(t);const a=r.width;const o=r.height;let l=e.offsetY-(r.top-n.top);let c=e.offsetX-(r.left-n.left);if(e.changedTouches){c=e.changedTouches[0].pageX-r.left;l=e.changedTouches[0].pageY+r.top;if(f){c-=i.x;l-=i.y}}s.y=1-Math.max(0,Math.min(1,l/o));s.x=Math.max(0,Math.min(1,c/a));return s}function Xe(e){return Z(e)&&e.nodeType===3}function Ke(e){while(e.firstChild){e.removeChild(e.firstChild)}return e}function Qe(e){if(typeof e==="function"){e=e()}return(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==="function"){e=e()}if(xe(e)||Xe(e)){return e}if(typeof e==="string"&&/\S/.test(e)){return Ny.createTextNode(e)}}).filter(e=>e)}function Je(t,e){Qe(e).forEach(e=>t.appendChild(e));return t}function Ze(e,t){return Je(Ke(e),t)}function et(e){if(e.button===undefined&&e.buttons===undefined){return true}if(e.button===0&&e.buttons===undefined){return true}if(e.type==="mouseup"&&e.button===0&&e.buttons===0){return true}if(e.type==="mousedown"&&e.button===0&&e.buttons===0){return true}if(e.button!==0||e.buttons!==1){return false}return true}const tt=Pe("querySelector");const it=Pe("querySelectorAll");function st(t,i){if(!t||!i){return""}if(typeof Ly.getComputedStyle==="function"){let e;try{e=Ly.getComputedStyle(t)}catch(e){return""}return e?e.getPropertyValue(i)||e[i]:""}return""}function nt(n){[...Ny.styleSheets].forEach(t=>{try{const e=[...t.cssRules].map(e=>e.cssText).join("");const i=Ny.createElement("style");i.textContent=e;n.document.head.appendChild(i)}catch(e){const s=Ny.createElement("link");s.rel="stylesheet";s.type=t.type;s.media=t.media.mediaText;s.href=t.href;n.document.head.appendChild(s)}})}var rt=Object.freeze({__proto__:null,isReal:De,isEl:xe,isInFrame:Oe,createEl:p,textContent:Re,prependTo:Le,hasClass:Ne,addClass:Me,removeClass:Ue,toggleClass:Be,setAttributes:Fe,getAttributes:qe,getAttribute:je,setAttribute:Ve,removeAttribute:$e,blockTextSelection:He,unblockTextSelection:Ge,getBoundingClientRect:ze,findPosition:We,getPointerPosition:Ye,isTextNode:Xe,emptyEl:Ke,normalizeContent:Qe,appendContent:Je,insertContent:Ze,isSingleLeftClick:et,$:tt,$$:it,computedStyle:st,copyStyleSheetsToWindow:nt});let at=false;let ot;const lt=function(){if(ot.options.autoSetup===false){return}const e=Array.prototype.slice.call(Ny.getElementsByTagName("video"));const t=Array.prototype.slice.call(Ny.getElementsByTagName("audio"));const i=Array.prototype.slice.call(Ny.getElementsByTagName("video-js"));const s=e.concat(t,i);if(s&&s.length>0){for(let e=0,t=s.length;e<t;e++){const n=s[e];if(n&&n.getAttribute){if(n.player===undefined){const r=n.getAttribute("data-setup");if(r!==null){ot(n)}}}else{ct(1);break}}}else if(!at){ct(1)}};function ct(e,t){if(!De()){return}if(t){ot=t}Ly.setTimeout(lt,e)}function ut(){at=true;Ly.removeEventListener("load",ut)}if(De()){if(Ny.readyState==="complete"){ut()}else{Ly.addEventListener("load",ut)}}const dt=function(e){const t=Ny.createElement("style");t.className=e;return t};const ht=function(e,t){if(e.styleSheet){e.styleSheet.cssText=t}else{e.textContent=t}};var o=new WeakMap;const ft=3;let pt=ft;function mt(){return pt++}function gt(e,t){if(!o.has(e)){return}const i=o.get(e);if(i.handlers[t].length===0){delete i.handlers[t];if(e.removeEventListener){e.removeEventListener(t,i.dispatcher,false)}else if(e.detachEvent){e.detachEvent("on"+t,i.dispatcher)}}if(Object.getOwnPropertyNames(i.handlers).length<=0){delete i.handlers;delete i.dispatcher;delete i.disabled}if(Object.getOwnPropertyNames(i).length===0){o.delete(e)}}function yt(t,i,e,s){e.forEach(function(e){t(i,e,s)})}function _t(t){if(t.fixed_){return t}function e(){return true}function i(){return false}if(!t||!t.isPropagationStopped||!t.isImmediatePropagationStopped){const s=t||Ly.event;t={};const n=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const r in s){if(!n.includes(r)){if(!(r==="returnValue"&&s.preventDefault)){t[r]=s[r]}}}if(!t.target){t.target=t.srcElement||Ny}if(!t.relatedTarget){t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement}t.preventDefault=function(){if(s.preventDefault){s.preventDefault()}t.returnValue=false;s.returnValue=false;t.defaultPrevented=true};t.defaultPrevented=false;t.stopPropagation=function(){if(s.stopPropagation){s.stopPropagation()}t.cancelBubble=true;s.cancelBubble=true;t.isPropagationStopped=e};t.isPropagationStopped=i;t.stopImmediatePropagation=function(){if(s.stopImmediatePropagation){s.stopImmediatePropagation()}t.isImmediatePropagationStopped=e;t.stopPropagation()};t.isImmediatePropagationStopped=i;if(t.clientX!==null&&t.clientX!==undefined){const a=Ny.documentElement;const e=Ny.body;t.pageX=t.clientX+(a&&a.scrollLeft||e&&e.scrollLeft||0)-(a&&a.clientLeft||e&&e.clientLeft||0);t.pageY=t.clientY+(a&&a.scrollTop||e&&e.scrollTop||0)-(a&&a.clientTop||e&&e.clientTop||0)}t.which=t.charCode||t.keyCode;if(t.button!==null&&t.button!==undefined){t.button=t.button&1?0:t.button&4?1:t.button&2?2:0}}t.fixed_=true;return t}let vt;const bt=function(){if(typeof vt!=="boolean"){vt=false;try{const e=Object.defineProperty({},"passive",{get(){vt=true}});Ly.addEventListener("test",null,e);Ly.removeEventListener("test",null,e)}catch(e){}}return vt};const Tt=["touchstart","touchmove"];function St(r,t,e){if(Array.isArray(t)){return yt(St,r,t,e)}if(!o.has(r)){o.set(r,{})}const a=o.get(r);if(!a.handlers){a.handlers={}}if(!a.handlers[t]){a.handlers[t]=[]}if(!e.guid){e.guid=mt()}a.handlers[t].push(e);if(!a.dispatcher){a.disabled=false;a.dispatcher=function(i,s){if(a.disabled){return}i=_t(i);const e=a.handlers[i.type];if(e){const n=e.slice(0);for(let e=0,t=n.length;e<t;e++){if(i.isImmediatePropagationStopped()){break}else{try{n[e].call(r,i,s)}catch(e){d.error(e)}}}}}}if(a.handlers[t].length===1){if(r.addEventListener){let e=false;if(bt()&&Tt.indexOf(t)>-1){e={passive:true}}r.addEventListener(t,a.dispatcher,e)}else if(r.attachEvent){r.attachEvent("on"+t,a.dispatcher)}}}function l(e,t,i){if(!o.has(e)){return}const s=o.get(e);if(!s.handlers){return}if(Array.isArray(t)){return yt(l,e,t,i)}const n=function(e,t){s.handlers[t]=[];gt(e,t)};if(t===undefined){for(const a in s.handlers){if(Object.prototype.hasOwnProperty.call(s.handlers||{},a)){n(e,a)}}return}const r=s.handlers[t];if(!r){return}if(!i){n(e,t);return}if(i.guid){for(let e=0;e<r.length;e++){if(r[e].guid===i.guid){r.splice(e--,1)}}}gt(e,t)}function Et(e,t,i){const s=o.has(e)?o.get(e):{};const n=e.parentNode||e.ownerDocument;if(typeof t==="string"){t={type:t,target:e}}else if(!t.target){t.target=e}t=_t(t);if(s.dispatcher){s.dispatcher.call(e,t,i)}if(n&&!t.isPropagationStopped()&&t.bubbles===true){Et.call(null,n,t,i)}else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){if(!o.has(t.target)){o.set(t.target,{})}const r=o.get(t.target);if(t.target[t.type]){r.disabled=true;if(typeof t.target[t.type]==="function"){t.target[t.type]()}r.disabled=false}}return!t.defaultPrevented}function wt(e,t,i){if(Array.isArray(t)){return yt(wt,e,t,i)}const s=function(){l(e,t,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||mt();St(e,t,s)}function It(e,t,i){const s=function(){l(e,t,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||mt();St(e,t,s)}var Ct=Object.freeze({__proto__:null,fixEvent:_t,on:St,off:l,trigger:Et,one:wt,any:It});const kt=30;const m=function(e,t,i){if(!t.guid){t.guid=mt()}const s=t.bind(e);s.guid=i?i+"_"+t.guid:t.guid;return s};const At=function(i,s){let n=Ly.performance.now();const e=function(...e){const t=Ly.performance.now();if(t-n>=s){i(...e);n=t}};return e};const Dt=function(s,n,r,a=Ly){let o;const e=()=>{a.clearTimeout(o);o=null};const t=function(){const e=this;const t=arguments;let i=function(){o=null;i=null;if(!r){s.apply(e,t)}};if(!o&&r){s.apply(e,t)}a.clearTimeout(o);o=a.setTimeout(i,n)};t.cancel=e;return t};var xt=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:kt,bind_:m,throttle:At,debounce:Dt});let Ot;class Pt{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{};St(this,e,t);this.addEventListener=i}off(e,t){l(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{};wt(this,e,t);this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{};It(this,e,t);this.addEventListener=i}trigger(e){const t=e.type||e;if(typeof e==="string"){e={type:t}}e=_t(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}Et(this,e)}queueTrigger(e){if(!Ot){Ot=new Map}const t=e.type||e;let i=Ot.get(this);if(!i){i=new Map;Ot.set(this,i)}const s=i.get(t);i.delete(t);Ly.clearTimeout(s);const n=Ly.setTimeout(()=>{i.delete(t);if(i.size===0){i=null;Ot.delete(this)}this.trigger(e)},0);i.set(t,n)}}Pt.prototype.allowedEvents_={};Pt.prototype.addEventListener=Pt.prototype.on;Pt.prototype.removeEventListener=Pt.prototype.off;Pt.prototype.dispatchEvent=Pt.prototype.trigger;const Rt=e=>{if(typeof e.name==="function"){return e.name()}if(typeof e.name==="string"){return e.name}if(e.name_){return e.name_}if(e.constructor&&e.constructor.name){return e.constructor.name}return typeof e};const Lt=t=>t instanceof Pt||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof t[e]==="function");const Nt=(e,t)=>{if(Lt(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}};const Mt=e=>typeof e==="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length;const Ut=(e,t,i)=>{if(!e||!e.nodeName&&!Lt(e)){throw new Error(`Invalid target for ${Rt(t)}#${i}; must be a DOM node or evented object.`)}};const Bt=(e,t,i)=>{if(!Mt(e)){throw new Error(`Invalid event type for ${Rt(t)}#${i}; must be a non-empty string or array.`)}};const Ft=(e,t,i)=>{if(typeof e!=="function"){throw new Error(`Invalid listener for ${Rt(t)}#${i}; must be a function.`)}};const qt=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n;let r;let a;if(s){n=e.eventBusEl_;if(t.length>=3){t.shift()}[r,a]=t}else{n=t[0];r=t[1];a=t[2]}Ut(n,e,i);Bt(r,e,i);Ft(a,e,i);a=m(e,a);return{isTargetingSelf:s,target:n,type:r,listener:a}};const jt=(e,t,i,s)=>{Ut(e,e,t);if(e.nodeName){Ct[t](e,i,s)}else{e[t](i,s)}};const Vt={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=qt(this,e,"on");jt(i,"on",s,n);if(!t){const r=()=>this.off(i,s,n);r.guid=n.guid;const a=()=>this.off("dispose",r);a.guid=n.guid;jt(this,"on","dispose",r);jt(i,"on","dispose",a)}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=qt(this,e,"one");if(t){jt(i,"one",s,n)}else{const r=(...e)=>{this.off(i,s,r);n.apply(null,e)};r.guid=n.guid;jt(i,"one",s,r)}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=qt(this,e,"any");if(t){jt(i,"any",s,n)}else{const r=(...e)=>{this.off(i,s,r);n.apply(null,e)};r.guid=n.guid;jt(i,"any",s,r)}},off(e,t,i){if(!e||Mt(e)){l(this.eventBusEl_,e,t)}else{const s=e;const n=t;Ut(s,this,"off");Bt(n,this,"off");Ft(i,this,"off");i=m(this,i);this.off("dispose",i);if(s.nodeName){l(s,n,i);l(s,"dispose",i)}else if(Lt(s)){s.off(n,i);s.off("dispose",i)}}},trigger(e,t){Ut(this.eventBusEl_,this,"trigger");const i=e&&typeof e!=="string"?e.type:e;if(!Mt(i)){throw new Error(`Invalid event type for ${Rt(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}return Et(this.eventBusEl_,e,t)}};function $t(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName){throw new Error(`The eventBusKey "${i}" does not refer to an element.`)}e.eventBusEl_=e[i]}else{e.eventBusEl_=p("span",{className:"vjs-event-bus"})}Object.assign(e,Vt);if(e.eventedCallbacks){e.eventedCallbacks.forEach(e=>{e()})}e.on("dispose",()=>{e.off();[e,e.el_,e.eventBusEl_].forEach(function(e){if(e&&o.has(e)){o.delete(e)}});Ly.setTimeout(()=>{e.eventBusEl_=null},0)});return e}const Ht={state:{},setState(e){if(typeof e==="function"){e=e()}let i;Q(e,(e,t)=>{if(this.state[t]!==e){i=i||{};i[t]={from:this.state[t],to:e}}this.state[t]=e});if(i&&Lt(this)){this.trigger({changes:i,type:"statechanged"})}return i}};function Gt(e,t){Object.assign(e,Ht);e.state=Object.assign({},e.state,t);if(typeof e.handleStateChanged==="function"&&Lt(e)){e.on("statechanged",e.handleStateChanged)}return e}const zt=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toLowerCase())};const c=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toUpperCase())};const Wt=function(e,t){return c(e)===c(t)};var Yt=Object.freeze({__proto__:null,toLowerCase:zt,toTitleCase:c,titleCaseEquals:Wt});class g{constructor(e,t,i){if(!e&&this.play){this.player_=e=this}else{this.player_=e}this.isDisposed_=false;this.parentComponent_=null;this.options_=h({},this.options_);t=this.options_=h(this.options_,t);this.id_=t.id||t.el&&t.el.id;if(!this.id_){const s=e&&e.id&&e.id()||"no_player";this.id_=`${s}_component_${mt()}`}this.name_=t.name||null;if(t.el){this.el_=t.el}else if(t.createEl!==false){this.el_=this.createEl()}if(t.className&&this.el_){t.className.split(" ").forEach(e=>this.addClass(e))}["on","off","one","any","trigger"].forEach(e=>{this[e]=undefined});if(t.evented!==false){$t(this,{eventBusKey:this.el_?"el_":null});this.handleLanguagechange=this.handleLanguagechange.bind(this);this.on(this.player_,"languagechange",this.handleLanguagechange)}Gt(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};this.setTimeoutIds_=new Set;this.setIntervalIds_=new Set;this.rafIds_=new Set;this.namedRafs_=new Map;this.clearingTimersOnDispose_=false;if(t.initChildren!==false){this.initChildren()}this.ready(i);if(t.reportTouchActivity!==false){this.enableTouchActivity()}}dispose(e={}){if(this.isDisposed_){return}if(this.readyQueue_){this.readyQueue_.length=0}this.trigger({type:"dispose",bubbles:false});this.isDisposed_=true;if(this.children_){for(let e=this.children_.length-1;e>=0;e--){if(this.children_[e].dispose){this.children_[e].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){if(e.restoreEl){this.el_.parentNode.replaceChild(e.restoreEl,this.el_)}else{this.el_.parentNode.removeChild(this.el_)}}this.el_=null}this.player_=null}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){if(!e){return this.options_}this.options_=h(this.options_,e);return this.options_}el(){return this.el_}createEl(e,t,i){return p(e,t,i)}localize(e,n,t=e){const i=this.player_.language&&this.player_.language();const s=this.player_.languages&&this.player_.languages();const r=s&&s[i];const a=i&&i.split("-")[0];const o=s&&s[a];let l=t;if(r&&r[e]){l=r[e]}else if(o&&o[e]){l=o[e]}if(n){l=l.replace(/\{(\d+)\}/g,function(e,t){const i=n[t-1];let s=i;if(typeof i==="undefined"){s=e}return s})}return l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(!e){return}return this.childNameIndex_[e]}getDescendant(...t){t=t.reduce((e,t)=>e.concat(t),[]);let i=this;for(let e=0;e<t.length;e++){i=i.getChild(t[e]);if(!i||!i.getChild){return}}return i}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons){return}const i="http://www.w3.org/2000/svg";const s=p("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"});const n=Ny.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const r=Ny.createElementNS(i,"use");n.appendChild(r);r.setAttributeNS(null,"href",`#vjs-icon-${e}`);s.appendChild(n);if(this.iconIsSet_){t.replaceChild(s,t.querySelector(".vjs-icon-placeholder"))}else{t.appendChild(s)}this.iconIsSet_=true;return s}addChild(e,t={},i=this.children_.length){let s;let n;if(typeof e==="string"){n=c(e);const r=t.componentClass||n;t.name=n;const a=g.getComponent(r);if(!a){throw new Error(`Component ${r} does not exist`)}if(typeof a!=="function"){return null}s=new a(this.player_||this,t)}else{s=e}if(s.parentComponent_){s.parentComponent_.removeChild(s)}this.children_.splice(i,0,s);s.parentComponent_=this;if(typeof s.id==="function"){this.childIndex_[s.id()]=s}n=n||s.name&&c(s.name());if(n){this.childNameIndex_[n]=s;this.childNameIndex_[zt(n)]=s}if(typeof s.el==="function"&&s.el()){let e=null;if(this.children_[i+1]){if(this.children_[i+1].el_){e=this.children_[i+1].el_}else if(xe(this.children_[i+1])){e=this.children_[i+1]}}this.contentEl().insertBefore(s.el(),e)}return s}removeChild(t){if(typeof t==="string"){t=this.getChild(t)}if(!t||!this.children_){return}let i=false;for(let e=this.children_.length-1;e>=0;e--){if(this.children_[e]===t){i=true;this.children_.splice(e,1);break}}if(!i){return}t.parentComponent_=null;this.childIndex_[t.id()]=null;this.childNameIndex_[c(t.name())]=null;this.childNameIndex_[zt(t.name())]=null;const e=t.el();if(e&&e.parentNode===this.contentEl()){this.contentEl().removeChild(t.el())}}initChildren(){const s=this.options_.children;if(s){const n=this.options_;const t=e=>{const t=e.name;let i=e.opts;if(n[t]!==undefined){i=n[t]}if(i===false){return}if(i===true){i={}}i.playerOptions=this.options_.playerOptions;const s=this.addChild(t,i);if(s){this[t]=s}};let e;const i=g.getComponent("Tech");if(Array.isArray(s)){e=s}else{e=Object.keys(s)}e.concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){if(typeof e==="string"){return t===e}return t===e.name})})).map(e=>{let t;let i;if(typeof e==="string"){t=e;i=s[t]||this.options_[t]||{}}else{t=e.name;i=e}return{name:t,opts:i}}).filter(e=>{const t=g.getComponent(e.opts.componentClass||c(e.name));return t&&!i.isTech(t)}).forEach(t)}}buildCSSClass(){return""}ready(e,t=false){if(!e){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(e);return}if(t){e.call(this)}else{this.setTimeout(e,1)}}triggerReady(){this.isReady_=true;this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[];if(e&&e.length>0){e.forEach(function(e){e.call(this)},this)}this.trigger("ready")},1)}$(e,t){return tt(e,t||this.contentEl())}$$(e,t){return it(e,t||this.contentEl())}hasClass(e){return Ne(this.el_,e)}addClass(...e){Me(this.el_,...e)}removeClass(...e){Ue(this.el_,...e)}toggleClass(e,t){Be(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return je(this.el_,e)}setAttribute(e,t){Ve(this.el_,e,t)}removeAttribute(e){$e(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,true);this.height(t)}dimension(e,t,i){if(t!==undefined){if(t===null||t!==t){t=0}if((""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1){this.el_.style[e]=t}else if(t==="auto"){this.el_.style[e]=""}else{this.el_.style[e]=t+"px"}if(!i){this.trigger("componentresize")}return}if(!this.el_){return 0}const s=this.el_.style[e];const n=s.indexOf("px");if(n!==-1){return parseInt(s.slice(0,n),10)}return parseInt(this.el_["offset"+c(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height"){throw new Error("currentDimension only accepts width or height value")}t=st(this.el_,e);t=parseFloat(t);if(t===0||isNaN(t)){const i=`offset${c(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();const t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left};const i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){if(this.player_){if(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)){e.stopPropagation()}this.player_.handleKeyDown(e)}}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let i=0;let n=null;const r=10;const s=200;let a;this.on("touchstart",function(e){if(e.touches.length===1){n={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY};i=Ly.performance.now();a=true}});this.on("touchmove",function(e){if(e.touches.length>1){a=false}else if(n){const t=e.touches[0].pageX-n.pageX;const i=e.touches[0].pageY-n.pageY;const s=Math.sqrt(t*t+i*i);if(s>r){a=false}}});const e=function(){a=false};this.on("touchleave",e);this.on("touchcancel",e);this.on("touchend",function(e){n=null;if(a===true){const t=Ly.performance.now()-i;if(t<s){e.preventDefault();this.trigger("tap")}}})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity){return}const t=m(this.player(),this.player().reportUserActivity);let i;this.on("touchstart",function(){t();this.clearInterval(i);i=this.setInterval(t,250)});const e=function(e){t();this.clearInterval(i)};this.on("touchmove",t);this.on("touchend",e);this.on("touchcancel",e)}setTimeout(e,t){var i;e=m(this,e);this.clearTimersOnDispose_();i=Ly.setTimeout(()=>{if(this.setTimeoutIds_.has(i)){this.setTimeoutIds_.delete(i)}e()},t);this.setTimeoutIds_.add(i);return i}clearTimeout(e){if(this.setTimeoutIds_.has(e)){this.setTimeoutIds_.delete(e);Ly.clearTimeout(e)}return e}setInterval(e,t){e=m(this,e);this.clearTimersOnDispose_();const i=Ly.setInterval(e,t);this.setIntervalIds_.add(i);return i}clearInterval(e){if(this.setIntervalIds_.has(e)){this.setIntervalIds_.delete(e);Ly.clearInterval(e)}return e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;e=m(this,e);t=Ly.requestAnimationFrame(()=>{if(this.rafIds_.has(t)){this.rafIds_.delete(t)}e()});this.rafIds_.add(t);return t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e)){this.cancelNamedAnimationFrame(e)}this.clearTimersOnDispose_();t=m(this,t);const i=this.requestAnimationFrame(()=>{t();if(this.namedRafs_.has(e)){this.namedRafs_.delete(e)}});this.namedRafs_.set(e,i);return e}cancelNamedAnimationFrame(e){if(!this.namedRafs_.has(e)){return}this.cancelAnimationFrame(this.namedRafs_.get(e));this.namedRafs_.delete(e)}cancelAnimationFrame(e){if(this.rafIds_.has(e)){this.rafIds_.delete(e);Ly.cancelAnimationFrame(e)}return e}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=true;this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,i])=>{this[e].forEach((e,t)=>this[i](t))});this.clearingTimersOnDispose_=false})}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){const t=e||this.el_;return t.tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){const t=Ly.getComputedStyle(e,null);const i=t.getPropertyValue("visibility");const s=t.getPropertyValue("display");const n=["hidden","collapse"];return s!=="none"&&!n.includes(i)}function i(e){if(!t(e.parentElement)){return false}if(!t(e)||e.style.opacity==="0"||Ly.getComputedStyle(e).height==="0px"||Ly.getComputedStyle(e).width==="0px"){return false}return true}function s(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0){return false}const t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0){return false}if(t.x>(Ny.documentElement.clientWidth||Ly.innerWidth)){return false}if(t.y<0){return false}if(t.y>(Ny.documentElement.clientHeight||Ly.innerHeight)){return false}let i=Ny.elementFromPoint(t.x,t.y);while(i){if(i===e){return true}if(i.parentNode){i=i.parentNode}else{return false}}}if(!e){e=this.el()}if(s(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0)){return true}return false}static registerComponent(t,e){if(typeof t!=="string"||!t){throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`)}const i=g.getComponent("Tech");const s=i&&i.isTech(e);const n=g===e||g.prototype.isPrototypeOf(e.prototype);if(s||!n){let e;if(s){e="techs must be registered using Tech.registerTech()"}else{e="must be a Component subclass"}throw new Error(`Illegal component, "${t}"; ${e}.`)}t=c(t);if(!g.components_){g.components_={}}const r=g.getComponent("Player");if(t==="Player"&&r&&r.players){const a=r.players;const o=Object.keys(a);if(a&&o.length>0&&o.map(e=>a[e]).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}g.components_[t]=e;g.components_[zt(t)]=e;return e}static getComponent(e){if(!e||!g.components_){return}return g.components_[e]}}g.registerComponent("Component",g);function Xt(e,t,i){if(typeof t!=="number"||t<0||t>i){throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}}function Kt(e,t,i,s){Xt(e,s,i.length-1);return i[s][t]}function Qt(e){let t;if(e===undefined||e.length===0){t={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}}else{t={length:e.length,start:Kt.bind(null,"start",0,e),end:Kt.bind(null,"end",1,e)}}if(Ly.Symbol&&Ly.Symbol.iterator){t[Ly.Symbol.iterator]=()=>(e||[]).values()}return t}function Jt(e,t){if(Array.isArray(e)){return Qt(e)}else if(e===undefined||t===undefined){return Qt()}return Qt([[e,t]])}const Zt=function(e,t){e=e<0?0:e;let i=Math.floor(e%60);let s=Math.floor(e/60%60);let n=Math.floor(e/3600);const r=Math.floor(t/60%60);const a=Math.floor(t/3600);if(isNaN(e)||e===Infinity){n=s=i="-"}n=n>0||a>0?n+":":"";s=((n||r>=10)&&s<10?"0"+s:s)+":";i=i<10?"0"+i:i;return n+s+i};let ei=Zt;function ti(e){ei=e}function ii(){ei=Zt}function si(e,t=e){return ei(e,t)}var ni=Object.freeze({__proto__:null,createTimeRanges:Jt,createTimeRange:Jt,setFormatTime:ti,resetFormatTime:ii,formatTime:si});function ri(t,i){let s=0;let n;let r;if(!i){return 0}if(!t||!t.length){t=Jt(0,0)}for(let e=0;e<t.length;e++){n=t.start(e);r=t.end(e);if(r>i){r=i}s+=r-n}return s/i}function t(e){if(e instanceof t){return e}if(typeof e==="number"){this.code=e}else if(typeof e==="string"){this.message=e}else if(Z(e)){if(typeof e.code==="number"){this.code=e.code}Object.assign(this,e)}if(!this.message){this.message=t.defaultMessages[this.code]||""}}t.prototype.code=0;t.prototype.message="";t.prototype.status=null;t.prototype.metadata=null;t.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];t.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};t.MEDIA_ERR_CUSTOM=0;t.prototype.MEDIA_ERR_CUSTOM=0;t.MEDIA_ERR_ABORTED=1;t.prototype.MEDIA_ERR_ABORTED=1;t.MEDIA_ERR_NETWORK=2;t.prototype.MEDIA_ERR_NETWORK=2;t.MEDIA_ERR_DECODE=3;t.prototype.MEDIA_ERR_DECODE=3;t.MEDIA_ERR_SRC_NOT_SUPPORTED=4;t.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;t.MEDIA_ERR_ENCRYPTED=5;t.prototype.MEDIA_ERR_ENCRYPTED=5;function ai(e){return e!==undefined&&e!==null&&typeof e.then==="function"}function oi(e){if(ai(e)){e.then(null,e=>{})}}const li=function(s){const e=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>{if(s[t]){e[t]=s[t]}return e},{cues:s.cues&&Array.prototype.map.call(s.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})});return e};const ci=function(e){const t=e.$$("track");const i=Array.prototype.map.call(t,e=>e.track);const s=Array.prototype.map.call(t,function(e){const t=li(e.track);if(e.src){t.src=e.src}return t});return s.concat(Array.prototype.filter.call(e.textTracks(),function(e){return i.indexOf(e)===-1}).map(li))};const ui=function(e,i){e.forEach(function(e){const t=i.addRemoteTextTrack(e).track;if(!e.src&&e.cues){e.cues.forEach(e=>t.addCue(e))}});return i.textTracks()};var di={textTracksToJson:ci,jsonToTextTracks:ui,trackToJson_:li};const hi="vjs-modal-dialog";class fi extends g{constructor(e,t){super(e,t);this.handleKeyDown_=e=>this.handleKeyDown(e);this.close_=e=>this.close(e);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=false;this.closeable(!this.options_.uncloseable);this.content(this.options_.content);this.contentEl_=p("div",{className:`${hi}-content`},{role:"document"});this.descEl_=p("p",{className:`${hi}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")});Re(this.descEl_,this.description());this.el_.appendChild(this.descEl_);this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;super.dispose()}buildCSSClass(){return`${hi} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e}open(){if(this.opened_){if(this.options_.fillAlways){this.fill()}return}const e=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown_);this.hadControls_=e.controls();e.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}opened(e){if(typeof e==="boolean"){this[e?"open":"close"]()}return this.opened_}close(){if(!this.opened_){return}const e=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown_);if(this.hadControls_){e.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger({type:"modalclose",bubbles:true});this.conditionalBlur_();if(this.options_.temporary){this.dispose()}}closeable(t){if(typeof t==="boolean"){const i=this.closeable_=!!t;let e=this.getChild("closeButton");if(i&&!e){const s=this.contentEl_;this.contentEl_=this.el_;e=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=s;this.on(e,"close",this.close_)}if(!i&&e){this.off(e,"close",this.close_);this.removeChild(e);e.dispose()}}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl();const i=t.parentNode;const s=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;i.removeChild(t);this.empty();Ze(t,e);this.trigger("modalfill");if(s){i.insertBefore(t,s)}else{i.appendChild(t)}const n=this.getChild("closeButton");if(n){i.appendChild(n.el_)}this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty");Ke(this.contentEl());this.trigger("modalempty")}content(e){if(typeof e!=="undefined"){this.content_=e}return this.content_}conditionalFocus_(){const e=Ny.activeElement;const t=this.player_.el_;this.previouslyActiveEl_=null;if(t.contains(e)||t===e){this.previouslyActiveEl_=e;this.focus()}}conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}}handleKeyDown(e){this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:true});e.stopPropagation();if(e.key==="Escape"&&this.closeable()){e.preventDefault();this.close();return}if(e.key!=="Tab"){return}const t=this.focusableEls_();const i=this.el_.querySelector(":focus");let s;for(let e=0;e<t.length;e++){if(i===t[e]){s=e;break}}if(Ny.activeElement===this.el_){s=0}if(e.shiftKey&&s===0){t[t.length-1].focus();e.preventDefault()}else if(!e.shiftKey&&s===t.length-1){t[0].focus();e.preventDefault()}}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>{return(e instanceof Ly.HTMLAnchorElement||e instanceof Ly.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof Ly.HTMLInputElement||e instanceof Ly.HTMLSelectElement||e instanceof Ly.HTMLTextAreaElement||e instanceof Ly.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof Ly.HTMLIFrameElement||e instanceof Ly.HTMLObjectElement||e instanceof Ly.HTMLEmbedElement||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!==-1||e.hasAttribute("contenteditable")})}}fi.prototype.options_={pauseOnOpen:true,temporary:true};g.registerComponent("ModalDialog",fi);class pi extends Pt{constructor(t=[]){super();this.tracks_=[];Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let e=0;e<t.length;e++){this.addTrack(t[e])}}addTrack(e){const t=this.tracks_.length;if(!(""+t in this)){Object.defineProperty(this,t,{get(){return this.tracks_[t]}})}if(this.tracks_.indexOf(e)===-1){this.tracks_.push(e);this.trigger({track:e,type:"addtrack",target:this})}e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})};if(Lt(e)){e.addEventListener("labelchange",e.labelchange_)}}removeTrack(i){let s;for(let e=0,t=this.length;e<t;e++){if(this[e]===i){s=this[e];if(s.off){s.off()}this.tracks_.splice(e,1);break}}if(!s){return}this.trigger({track:s,type:"removetrack",target:this})}getTrackById(i){let s=null;for(let e=0,t=this.length;e<t;e++){const n=this[e];if(n.id===i){s=n;break}}return s}}pi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const xy in pi.prototype.allowedEvents_){pi.prototype["on"+xy]=null}const mi=function(t,i){for(let e=0;e<t.length;e++){if(!Object.keys(t[e]).length||i.id===t[e].id){continue}t[e].enabled=false}};class gi extends pi{constructor(t=[]){for(let e=t.length-1;e>=0;e--){if(t[e].enabled){mi(t,t[e]);break}}super(t);this.changing_=false}addTrack(e){if(e.enabled){mi(this,e)}super.addTrack(e);if(!e.addEventListener){return}e.enabledChange_=()=>{if(this.changing_){return}this.changing_=true;mi(this,e);this.changing_=false;this.trigger("change")};e.addEventListener("enabledchange",e.enabledChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.enabledChange_){e.removeEventListener("enabledchange",e.enabledChange_);e.enabledChange_=null}}}const yi=function(t,i){for(let e=0;e<t.length;e++){if(!Object.keys(t[e]).length||i.id===t[e].id){continue}t[e].selected=false}};class _i extends pi{constructor(t=[]){for(let e=t.length-1;e>=0;e--){if(t[e].selected){yi(t,t[e]);break}}super(t);this.changing_=false;Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++){if(this[e].selected){return e}}return-1},set(){}})}addTrack(e){if(e.selected){yi(this,e)}super.addTrack(e);if(!e.addEventListener){return}e.selectedChange_=()=>{if(this.changing_){return}this.changing_=true;yi(this,e);this.changing_=false;this.trigger("change")};e.addEventListener("selectedchange",e.selectedChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.selectedChange_){e.removeEventListener("selectedchange",e.selectedChange_);e.selectedChange_=null}}}class vi extends pi{addTrack(e){super.addTrack(e);if(!this.queueChange_){this.queueChange_=()=>this.queueTrigger("change")}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")}e.addEventListener("modechange",this.queueChange_);const t=["metadata","chapters"];if(t.indexOf(e.kind)===-1){e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}}removeTrack(e){super.removeTrack(e);if(e.removeEventListener){if(this.queueChange_){e.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){e.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}}}class bi{constructor(i=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let e=0,t=i.length;e<t;e++){this.addTrackElement_(i[e])}}addTrackElement_(e){const t=this.trackElements_.length;if(!(""+t in this)){Object.defineProperty(this,t,{get(){return this.trackElements_[t]}})}if(this.trackElements_.indexOf(e)===-1){this.trackElements_.push(e)}}getTrackElementByTrack_(i){let s;for(let e=0,t=this.trackElements_.length;e<t;e++){if(i===this.trackElements_[e].track){s=this.trackElements_[e];break}}return s}removeTrackElement_(i){for(let e=0,t=this.trackElements_.length;e<t;e++){if(i===this.trackElements_[e]){if(this.trackElements_[e].track&&typeof this.trackElements_[e].track.off==="function"){this.trackElements_[e].track.off()}if(typeof this.trackElements_[e].off==="function"){this.trackElements_[e].off()}this.trackElements_.splice(e,1);break}}}}class Ti{constructor(e){Ti.prototype.setCues_.call(this,e);Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const s=e.length;this.cues_=e;this.length_=e.length;const n=function(e){if(!(""+e in this)){Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})}};if(t<s){i=t;for(;i<s;i++){n.call(this,i)}}}getCueById(i){let s=null;for(let e=0,t=this.length;e<t;e++){const n=this[e];if(n.id===i){s=n;break}}return s}}const Si={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"};const Ei={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"};const wi={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"};const Ii={disabled:"disabled",hidden:"hidden",showing:"showing"};class Ci extends Pt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+mt(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const s in t){Object.defineProperty(this,s,{get(){return t[s]},set(){}})}Object.defineProperty(this,"label",{get(){return i},set(e){if(e!==i){i=e;this.trigger("labelchange")}}})}}const ki=function(e){return new URL(e,Ny.baseURI)};const Ai=function(e){return new URL(e,Ny.baseURI).href};const Di=function(e){if(typeof e==="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;const i=t.exec(e);if(i){return i.pop().toLowerCase()}}return""};const xi=function(e,t=Ly.location){return ki(e).origin!==t.origin};var Oi=Object.freeze({__proto__:null,parseUrl:ki,getAbsoluteURL:Ai,getFileExtension:Di,isCrossOrigin:xi});var Pi=typeof globalThis!=="undefined"?globalThis:typeof Ly!=="undefined"?Ly:typeof Ry!=="undefined"?Ry:typeof self!=="undefined"?self:{};function Ri(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function Li(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Ni;if(typeof Ly!=="undefined"){Ni=Ly}else if(typeof Pi!=="undefined"){Ni=Pi}else if(typeof self!=="undefined"){Ni=self}else{Ni={}}var Mi=Ni;var Ui=Li(function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},e.exports.__esModule=true,e.exports["default"]=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=true,e.exports["default"]=e.exports});var y=Ri(Ui);var Bi=qi;var Fi=Object.prototype.toString;function qi(e){if(!e){return false}var t=Fi.call(e);return t==="[object Function]"||typeof e==="function"&&t!=="[object RegExp]"||typeof Ly!=="undefined"&&(e===Ly.setTimeout||e===Ly.alert||e===Ly.confirm||e===Ly.prompt)}function ji(e,t){var i=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=Vi(e))||t&&e&&typeof e.length==="number"){if(i)e=i;var s=0;return function(){if(s>=e.length)return{done:true};return{done:false,value:e[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vi(e,t){if(!e)return;if(typeof e==="string")return $i(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return $i(e,t)}function $i(e,t){if(t==null||t>e.length)t=e.length;for(var i=0,s=new Array(t);i<t;i++){s[i]=e[i]}return s}var Hi=function(){function e(){this.typeToInterceptorsMap_=new Map;this.enabled_=false}var t=e.prototype;t.getIsEnabled=function e(){return this.enabled_};t.enable=function e(){this.enabled_=true};t.disable=function e(){this.enabled_=false};t.reset=function e(){this.typeToInterceptorsMap_=new Map;this.enabled_=false};t.addInterceptor=function e(t,i){if(!this.typeToInterceptorsMap_.has(t)){this.typeToInterceptorsMap_.set(t,new Set)}var s=this.typeToInterceptorsMap_.get(t);if(s.has(i)){return false}s.add(i);return true};t.removeInterceptor=function e(t,i){var s=this.typeToInterceptorsMap_.get(t);if(s&&s.has(i)){s.delete(i);return true}return false};t.clearInterceptorsByType=function e(t){var i=this.typeToInterceptorsMap_.get(t);if(!i){return false}this.typeToInterceptorsMap_.delete(t);this.typeToInterceptorsMap_.set(t,new Set);return true};t.clear=function e(){if(!this.typeToInterceptorsMap_.size){return false}this.typeToInterceptorsMap_=new Map;return true};t.getForType=function e(t){return this.typeToInterceptorsMap_.get(t)||new Set};t.execute=function e(t,i){var s=this.getForType(t);for(var n=ji(s),r;!(r=n()).done;){var a=r.value;try{i=a(i)}catch(e){}}return i};return e}();var Gi=Hi;var zi=function(){function e(){this.maxAttempts_=1;this.delayFactor_=.1;this.fuzzFactor_=.1;this.initialDelay_=1e3;this.enabled_=false}var t=e.prototype;t.getIsEnabled=function e(){return this.enabled_};t.enable=function e(){this.enabled_=true};t.disable=function e(){this.enabled_=false};t.reset=function e(){this.maxAttempts_=1;this.delayFactor_=.1;this.fuzzFactor_=.1;this.initialDelay_=1e3;this.enabled_=false};t.getMaxAttempts=function e(){return this.maxAttempts_};t.setMaxAttempts=function e(t){this.maxAttempts_=t};t.getDelayFactor=function e(){return this.delayFactor_};t.setDelayFactor=function e(t){this.delayFactor_=t};t.getFuzzFactor=function e(){return this.fuzzFactor_};t.setFuzzFactor=function e(t){this.fuzzFactor_=t};t.getInitialDelay=function e(){return this.initialDelay_};t.setInitialDelay=function e(t){this.initialDelay_=t};t.createRetry=function e(t){var i=t===void 0?{}:t,s=i.maxAttempts,n=i.delayFactor,r=i.fuzzFactor,a=i.initialDelay;return new Wi({maxAttempts:s||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:r||this.fuzzFactor_,initialDelay:a||this.initialDelay_})};return e}();var Wi=function(){function e(e){this.maxAttempts_=e.maxAttempts;this.delayFactor_=e.delayFactor;this.fuzzFactor_=e.fuzzFactor;this.currentDelay_=e.initialDelay;this.currentAttempt_=1}var t=e.prototype;t.moveToNextAttempt=function e(){this.currentAttempt_++;var t=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+t};t.shouldRetry=function e(){return this.currentAttempt_<this.maxAttempts_};t.getCurrentDelay=function e(){return this.currentDelay_};t.getCurrentMinPossibleDelay=function e(){return(1-this.fuzzFactor_)*this.currentDelay_};t.getCurrentMaxPossibleDelay=function e(){return(1+this.fuzzFactor_)*this.currentDelay_};t.getCurrentFuzzedDelay=function e(){var t=this.getCurrentMinPossibleDelay();var i=this.getCurrentMaxPossibleDelay();return t+Math.random()*(i-t)};return e}();var Yi=zi;var Xi=function e(r,a){if(a===void 0){a=false}return function(e,t,i){if(e){r(e);return}if(t.statusCode>=400&&t.statusCode<=599){var s=i;if(a){if(Mi.TextDecoder){var n=Ki(t.headers&&t.headers["content-type"]);try{s=new TextDecoder(n).decode(i)}catch(e){}}else{s=String.fromCharCode.apply(null,new Uint8Array(i))}}r({cause:s});return}r(null,i)}};function Ki(e){if(e===void 0){e=""}return e.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),s=i[0],n=i[1];if(s.trim()==="charset"){return n.trim()}return e},"utf-8")}var Qi=Xi;b.httpHandler=Qi;b.requestInterceptorsStorage=new Gi;b.responseInterceptorsStorage=new Gi;b.retryManager=new Yi;var Ji=function e(t){var n={};if(!t){return n}t.trim().split("\n").forEach(function(e){var t=e.indexOf(":");var i=e.slice(0,t).trim().toLowerCase();var s=e.slice(t+1).trim();if(typeof n[i]==="undefined"){n[i]=s}else if(Array.isArray(n[i])){n[i].push(s)}else{n[i]=[n[i],s]}});return n};var Zi=b;var es=b;b.XMLHttpRequest=Mi.XMLHttpRequest||as;b.XDomainRequest="withCredentials"in new b.XMLHttpRequest?b.XMLHttpRequest:Mi.XDomainRequest;ts(["get","put","post","patch","head","delete"],function(s){b[s==="delete"?"del":s]=function(e,t,i){t=ss(e,t,i);t.method=s.toUpperCase();return ns(t)}});function ts(e,t){for(var i=0;i<e.length;i++){t(e[i])}}function is(e){for(var t in e){if(e.hasOwnProperty(t))return false}return true}function ss(e,t,i){var s=e;if(Bi(t)){i=t;if(typeof e==="string"){s={uri:e}}}else{s=Ui({},t,{uri:e})}s.callback=i;return s}function b(e,t,i){t=ss(e,t,i);return ns(t)}function ns(r){if(typeof r.callback==="undefined"){throw new Error("callback argument missing")}if(r.requestType&&b.requestInterceptorsStorage.getIsEnabled()){var e={uri:r.uri||r.url,headers:r.headers||{},body:r.body,metadata:r.metadata||{},retry:r.retry,timeout:r.timeout};var t=b.requestInterceptorsStorage.execute(r.requestType,e);r.uri=t.uri;r.headers=t.headers;r.body=t.body;r.metadata=t.metadata;r.retry=t.retry;r.timeout=t.timeout}var n=false;var a=function e(t,i,s){if(!n){n=true;r.callback(t,i,s)}};function i(){if(c.readyState===4&&!b.responseInterceptorsStorage.getIsEnabled()){setTimeout(l,0)}}function o(){var e=undefined;if(c.response){e=c.response}else{e=c.responseText||rs(c)}if(y){try{e=JSON.parse(e)}catch(e){}}return e}function s(e){clearTimeout(_);clearTimeout(r.retryTimeout);if(!(e instanceof Error)){e=new Error(""+(e||"Unknown XMLHttpRequest Error"))}e.statusCode=0;if(!d&&b.retryManager.getIsEnabled()&&r.retry&&r.retry.shouldRetry()){r.retryTimeout=setTimeout(function(){r.retry.moveToNextAttempt();r.xhr=c;ns(r)},r.retry.getCurrentFuzzedDelay());return}if(r.requestType&&b.responseInterceptorsStorage.getIsEnabled()){var t={headers:v.headers||{},body:v.body,responseUrl:c.responseURL,responseType:c.responseType};var i=b.responseInterceptorsStorage.execute(r.requestType,t);v.body=i.body;v.headers=i.headers}return a(e,v)}function l(){if(d)return;var e;clearTimeout(_);clearTimeout(r.retryTimeout);if(r.useXDR&&c.status===undefined){e=200}else{e=c.status===1223?204:c.status}var t=v;var i=null;if(e!==0){t={body:o(),statusCode:e,method:f,headers:{},url:h,rawRequest:c};if(c.getAllResponseHeaders){t.headers=Ji(c.getAllResponseHeaders())}}else{i=new Error("Internal XMLHttpRequest Error")}if(r.requestType&&b.responseInterceptorsStorage.getIsEnabled()){var s={headers:t.headers||{},body:t.body,responseUrl:c.responseURL,responseType:c.responseType};var n=b.responseInterceptorsStorage.execute(r.requestType,s);t.body=n.body;t.headers=n.headers}return a(i,t,t.body)}var c=r.xhr||null;if(!c){if(r.cors||r.useXDR){c=new b.XDomainRequest}else{c=new b.XMLHttpRequest}}var u;var d;var h=c.url=r.uri||r.url;var f=c.method=r.method||"GET";var p=r.body||r.data;var m=c.headers=r.headers||{};var g=!!r.sync;var y=false;var _;var v={body:undefined,headers:{},statusCode:0,method:f,url:h,rawRequest:c};if("json"in r&&r.json!==false){y=true;m["accept"]||m["Accept"]||(m["Accept"]="application/json");if(f!=="GET"&&f!=="HEAD"){m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json");p=JSON.stringify(r.json===true?p:r.json)}}c.onreadystatechange=i;c.onload=l;c.onerror=s;c.onprogress=function(){};c.onabort=function(){d=true;clearTimeout(r.retryTimeout)};c.ontimeout=s;c.open(f,h,!g,r.username,r.password);if(!g){c.withCredentials=!!r.withCredentials}if(!g&&r.timeout>0){_=setTimeout(function(){if(d)return;d=true;c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";s(e)},r.timeout)}if(c.setRequestHeader){for(u in m){if(m.hasOwnProperty(u)){c.setRequestHeader(u,m[u])}}}else if(r.headers&&!is(r.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in r){c.responseType=r.responseType}if("beforeSend"in r&&typeof r.beforeSend==="function"){r.beforeSend(c)}c.send(p||null);return c}function rs(e){try{if(e.responseType==="document"){return e.responseXML}var t=e.responseXML&&e.responseXML.documentElement.nodeName==="parsererror";if(e.responseType===""&&!t){return e.responseXML}}catch(e){}return null}function as(){}Zi.default=es;const os=function(e,t){const i=new Ly.WebVTT.Parser(Ly,Ly.vttjs,Ly.WebVTT.StringDecoder());const s=[];i.oncue=function(e){t.addCue(e)};i.onparsingerror=function(e){s.push(e)};i.onflush=function(){t.trigger({type:"loadeddata",target:t})};i.parse(e);if(s.length>0){if(Ly.console&&Ly.console.groupCollapsed){Ly.console.groupCollapsed(`Text Track parsing errors for ${t.src}`)}s.forEach(e=>d.error(e));if(Ly.console&&Ly.console.groupEnd){Ly.console.groupEnd()}}i.flush()};const ls=function(e,s){const t={uri:e};const i=xi(e);if(i){t.cors=i}const n=s.tech_.crossOrigin()==="use-credentials";if(n){t.withCredentials=n}Zi(t,m(this,function(e,t,i){if(e){return d.error(e,t)}s.loaded_=true;if(typeof Ly.WebVTT!=="function"){if(s.tech_){s.tech_.any(["vttjsloaded","vttjserror"],e=>{if(e.type==="vttjserror"){d.error(`vttjs failed to load, stopping trying to process ${s.src}`);return}return os(i,s)})}}else{os(i,s)}}))};class cs extends Ci{constructor(e={}){if(!e.tech){throw new Error("A tech was not provided.")}const t=h(e,{kind:wi[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Ii[t.mode]||"disabled";const s=t.default;if(t.kind==="metadata"||t.kind==="chapters"){i="hidden"}super(t);this.tech_=t.tech;this.cues_=[];this.activeCues_=[];this.preload_=this.tech_.preloadTextTracks!==false;const n=new Ti(this.cues_);const r=new Ti(this.activeCues_);let a=false;this.timeupdateHandler=m(this,function(e={}){if(this.tech_.isDisposed()){return}if(!this.tech_.isReady_){if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}return}this.activeCues=this.activeCues;if(a){this.trigger("cuechange");a=false}if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}});const o=()=>{this.stopTracking()};this.tech_.one("dispose",o);if(i!=="disabled"){this.startTracking()}Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return i},set(e){if(!Ii[e]){return}if(i===e){return}i=e;if(!this.preload_&&i!=="disabled"&&this.cues.length===0){ls(this.src,this)}this.stopTracking();if(i!=="disabled"){this.startTracking()}this.trigger("modechange")}},cues:{get(){if(!this.loaded_){return null}return n},set(){}},activeCues:{get(){if(!this.loaded_){return null}if(this.cues.length===0){return r}const i=this.tech_.currentTime();const s=[];for(let e=0,t=this.cues.length;e<t;e++){const n=this.cues[e];if(n.startTime<=i&&n.endTime>=i){s.push(n)}}a=false;if(s.length!==this.activeCues_.length){a=true}else{for(let e=0;e<s.length;e++){if(this.activeCues_.indexOf(s[e])===-1){a=true}}}this.activeCues_=s;r.setCues_(this.activeCues_);return r},set(){}}});if(t.src){this.src=t.src;if(!this.preload_){this.loaded_=true}if(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions"){ls(this.src,this)}}else{this.loaded_=true}}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler);this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){if(this.rvf_){this.tech_.cancelVideoFrameCallback(this.rvf_);this.rvf_=undefined}this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new Ly.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const s in e){if(!(s in t)){t[s]=e[s]}}t.id=e.id;t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++){if(i[e]!==this){i[e].removeCue(t)}}this.cues_.push(t);this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;while(t--){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1);this.cues.setCues_(this.cues_);break}}}}cs.prototype.allowedEvents_={cuechange:"cuechange"};class us extends Ci{constructor(e={}){const t=h(e,{kind:Ei[e.kind]||""});super(t);let i=false;Object.defineProperty(this,"enabled",{get(){return i},set(e){if(typeof e!=="boolean"||e===i){return}i=e;this.trigger("enabledchange")}});if(t.enabled){this.enabled=t.enabled}this.loaded_=true}}class ds extends Ci{constructor(e={}){const t=h(e,{kind:Si[e.kind]||""});super(t);let i=false;Object.defineProperty(this,"selected",{get(){return i},set(e){if(typeof e!=="boolean"||e===i){return}i=e;this.trigger("selectedchange")}});if(t.selected){this.selected=t.selected}}}class hs extends Pt{constructor(e={}){super();let t;const i=new cs(e);this.kind=i.kind;this.src=i.src;this.srclang=i.language;this.label=i.label;this.default=i.default;Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}});t=hs.NONE;i.addEventListener("loadeddata",()=>{t=hs.LOADED;this.trigger({type:"load",target:this})})}}hs.prototype.allowedEvents_={load:"load"};hs.NONE=0;hs.LOADING=1;hs.LOADED=2;hs.ERROR=3;const fs={audio:{ListClass:gi,TrackClass:us,capitalName:"Audio"},video:{ListClass:_i,TrackClass:ds,capitalName:"Video"},text:{ListClass:vi,TrackClass:cs,capitalName:"Text"}};Object.keys(fs).forEach(function(e){fs[e].getterName=`${e}Tracks`;fs[e].privateName=`${e}Tracks_`});const ps={remoteText:{ListClass:vi,TrackClass:cs,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:bi,TrackClass:hs,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};const _=Object.assign({},fs,ps);ps.names=Object.keys(ps);fs.names=Object.keys(fs);_.names=[].concat(ps.names).concat(fs.names);var ms={};var gs=typeof Pi!=="undefined"?Pi:typeof Ly!=="undefined"?Ly:{};var ys;if(typeof Ny!=="undefined"){ys=Ny}else{ys=gs["__GLOBAL_DOCUMENT_CACHE@4"];if(!ys){ys=gs["__GLOBAL_DOCUMENT_CACHE@4"]=ms}}var _s=ys;var vs=Object.create||function(){function t(){}return function(e){if(arguments.length!==1){throw new Error("Object.create shim only accepts one parameter.")}t.prototype=e;return new t}}();function bs(e,t){this.name="ParsingError";this.code=e.code;this.message=t||e.message}bs.prototype=vs(Error.prototype);bs.prototype.constructor=bs;bs.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Ts(e){function t(e,t,i,s){return(e|0)*3600+(t|0)*60+(i|0)+(s|0)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!i){return null}if(i[3]){return t(i[1],i[2],i[3].replace(":",""),i[4])}else if(i[1]>59){return t(i[1],i[2],0,i[4])}else{return t(0,i[1],i[2],i[4])}}function Ss(){this.values=vs(null)}Ss.prototype={set:function(e,t){if(!this.get(e)&&t!==""){this.values[e]=t}},get:function(e,t,i){if(i){return this.has(e)?this.values[e]:t[i]}return this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var s=0;s<i.length;++s){if(t===i[s]){this.set(e,t);break}}},integer:function(e,t){if(/^-?\d+$/.test(t)){this.set(e,parseInt(t,10))}},percent:function(e,t){if(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)){t=parseFloat(t);if(t>=0&&t<=100){this.set(e,t);return true}}return false}};function Es(e,t,i,s){var n=s?e.split(s):[e];for(var r in n){if(typeof n[r]!=="string"){continue}var a=n[r].split(i);if(a.length!==2){continue}var o=a[0].trim();var l=a[1].trim();t(o,l)}}function ws(t,e,a){var i=t;function s(){var e=Ts(t);if(e===null){throw new bs(bs.Errors.BadTimeStamp,"Malformed timestamp: "+i)}t=t.replace(/^[^\sa-zA-Z-]+/,"");return e}function n(e,t){var r=new Ss;Es(e,function(e,t){switch(e){case"region":for(var i=a.length-1;i>=0;i--){if(a[i].id===t){r.set(e,a[i].region);break}}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),n=s[0];r.integer(e,n);r.percent(e,n)?r.set("snapToLines",false):null;r.alt(e,n,["auto"]);if(s.length===2){r.alt("lineAlign",s[1],["start","center","end"])}break;case"position":s=t.split(",");r.percent(e,s[0]);if(s.length===2){r.alt("positionAlign",s[1],["start","center","end"])}break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","center","end","left","right"]);break}},/:/,/\s/);t.region=r.get("region",null);t.vertical=r.get("vertical","");try{t.line=r.get("line","auto")}catch(e){}t.lineAlign=r.get("lineAlign","start");t.snapToLines=r.get("snapToLines",true);t.size=r.get("size",100);try{t.align=r.get("align","center")}catch(e){t.align=r.get("align","middle")}try{t.position=r.get("position","auto")}catch(e){t.position=r.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function r(){t=t.replace(/^\s+/,"")}r();e.startTime=s();r();if(t.substr(0,3)!=="--\x3e"){throw new bs(bs.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i)}t=t.substr(3);r();e.endTime=s();r();n(t,e)}var Is=_s.createElement&&_s.createElement("textarea");var Cs={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var ks={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"};var As={v:"title",lang:"lang"};var Ds={rt:"ruby"};function xs(r,i){function e(){if(!i){return null}function e(e){i=i.substr(e.length);return e}var t=i.match(/^([^<]*)(<[^>]*>?)?/);return e(t[1]?t[1]:t[2])}function t(e){Is.innerHTML=e;e=Is.textContent;Is.textContent="";return e}function s(e,t){return!Ds[t.localName]||Ds[t.localName]===e.localName}function n(e,t){var i=Cs[e];if(!i){return null}var s=r.document.createElement(i);var n=As[e];if(n&&t){s[n]=t.trim()}return s}var a=r.document.createElement("div"),o=a,l,c=[];while((l=e())!==null){if(l[0]==="<"){if(l[1]==="/"){if(c.length&&c[c.length-1]===l.substr(2).replace(">","")){c.pop();o=o.parentNode}continue}var u=Ts(l.substr(1,l.length-2));var d;if(u){d=r.document.createProcessingInstruction("timestamp",u);o.appendChild(d);continue}var h=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h){continue}d=n(h[1],h[3]);if(!d){continue}if(!s(o,d)){continue}if(h[2]){var f=h[2].split(".");f.forEach(function(e){var t=/^bg_/.test(e);var i=t?e.slice(3):e;if(ks.hasOwnProperty(i)){var s=t?"background-color":"color";var n=ks[i];d.style[s]=n}});d.className=f.join(" ")}c.push(h[1]);o.appendChild(d);o=d;continue}o.appendChild(r.document.createTextNode(t(l)))}return a}var Os=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Ps(e){for(var t=0;t<Os.length;t++){var i=Os[t];if(e>=i[0]&&e<=i[1]){return true}}return false}function Rs(e){var t=[],i="",s;if(!e||!e.childNodes){return"ltr"}function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--){e.push(t.childNodes[i])}}function r(e){if(!e||!e.length){return null}var t=e.pop(),i=t.textContent||t.innerText;if(i){var s=i.match(/^.*(\n|\r)/);if(s){e.length=0;return s[0]}return i}if(t.tagName==="ruby"){return r(e)}if(t.childNodes){n(e,t);return r(e)}}n(t,e);while(i=r(t)){for(var a=0;a<i.length;a++){s=i.charCodeAt(a);if(Ps(s)){return"rtl"}}}return"ltr"}function Ls(e){if(typeof e.line==="number"&&(e.snapToLines||e.line>=0&&e.line<=100)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}var t=e.track,i=t.textTrackList,s=0;for(var n=0;n<i.length&&i[n]!==t;n++){if(i[n].mode==="showing"){s++}}return++s*-1}function Ns(){}Ns.prototype.applyStyles=function(e,t){t=t||this.div;for(var i in e){if(e.hasOwnProperty(i)){t.style[i]=e[i]}}};Ns.prototype.formatStyle=function(e,t){return e===0?0:e+t};function Ms(e,t,i){Ns.call(this);this.cue=t;this.cueDiv=xs(e,t.text);var s={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv);this.div=e.document.createElement("div");s={direction:Rs(this.cueDiv),writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:t.align==="middle"?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(s);this.div.appendChild(this.cueDiv);var n=0;switch(t.positionAlign){case"start":case"line-left":n=t.position;break;case"center":n=t.position-t.size/2;break;case"end":case"line-right":n=t.position-t.size;break}if(t.vertical===""){this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(t.size,"%")})}else{this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(t.size,"%")})}this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}Ms.prototype=vs(Ns.prototype);Ms.prototype.constructor=Ms;function v(e){var t,i,s,n;if(e.div){i=e.div.offsetHeight;s=e.div.offsetWidth;n=e.div.offsetTop;var r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();e=e.div.getBoundingClientRect();t=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0}this.left=e.left;this.right=e.right;this.top=e.top||n;this.height=e.height||i;this.bottom=e.bottom||n+(e.height||i);this.width=e.width||s;this.lineHeight=t!==undefined?t:e.lineHeight}v.prototype.move=function(e,t){t=t!==undefined?t:this.lineHeight;switch(e){case"+x":this.left+=t;this.right+=t;break;case"-x":this.left-=t;this.right-=t;break;case"+y":this.top+=t;this.bottom+=t;break;case"-y":this.top-=t;this.bottom-=t;break}};v.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top};v.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++){if(this.overlaps(e[t])){return true}}return false};v.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};v.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}};v.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),s=t*i;return s/(this.height*this.width)};v.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}};v.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0;var i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0;var s=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var n={left:e.left,right:e.right,top:e.top||s,height:e.height||t,bottom:e.bottom||s+(e.height||t),width:e.width||i};return n};function Us(e,t,o,l){function i(e,t){var i,s=new v(e),n=1;for(var r=0;r<t.length;r++){while(e.overlapsOppositeAxis(o,t[r])||e.within(o)&&e.overlapsAny(l)){e.move(t[r])}if(e.within(o)){return e}var a=e.intersectPercentage(o);if(n>a){i=new v(e);n=a}e=new v(s)}return i||s}var s=new v(t),n=t.cue,r=Ls(n),a=[];if(n.snapToLines){var c;switch(n.vertical){case"":a=["+y","-y"];c="height";break;case"rl":a=["+x","-x"];c="width";break;case"lr":a=["-x","+x"];c="width";break}var u=s.lineHeight,d=u*Math.round(r),h=o[c]+u,f=a[0];if(Math.abs(d)>h){d=d<0?-1:1;d*=Math.ceil(h/u)*u}if(r<0){d+=n.vertical===""?o.height:o.width;a=a.reverse()}s.move(f,d)}else{var p=s.lineHeight/o.height*100;switch(n.lineAlign){case"center":r-=p/2;break;case"end":r-=p;break}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(r,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(r,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(r,"%")});break}a=["+y","-x","+x","-y"];s=new v(t)}var m=i(s,a);t.move(m.toCSSCompatValues(o))}function Bs(){}Bs.StringDecoder=function(){return{decode:function(e){if(!e){return""}if(typeof e!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(e))}}};Bs.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return xs(e,t)};var Fs=.05;var qs="sans-serif";var js="1.5%";Bs.processCues=function(s,n,e){if(!s||!n||!e){return null}while(e.firstChild){e.removeChild(e.firstChild)}var r=s.document.createElement("div");r.style.position="absolute";r.style.left="0";r.style.right="0";r.style.top="0";r.style.bottom="0";r.style.margin=js;e.appendChild(r);function t(e){for(var t=0;t<e.length;t++){if(e[t].hasBeenReset||!e[t].displayState){return true}}return false}if(!t(n)){for(var i=0;i<n.length;i++){r.appendChild(n[i].displayState)}return}var a=[],o=v.getSimpleBoxPosition(r),l=Math.round(o.height*Fs*100)/100;var c={font:l+"px "+qs};(function(){var e,t;for(var i=0;i<n.length;i++){t=n[i];e=new Ms(s,t,c);r.appendChild(e.div);Us(s,e,o,a);t.displayState=e.div;a.push(v.getSimpleBoxPosition(e))}})()};Bs.Parser=function(e,t,i){if(!i){i=t;t={}}if(!t){t={}}this.window=e;this.vttjs=t;this.state="INITIAL";this.buffer="";this.decoder=i||new TextDecoder("utf8");this.regionList=[]};Bs.Parser.prototype={reportOrThrowError:function(e){if(e instanceof bs){this.onparsingerror&&this.onparsingerror(e)}else{throw e}},parse:function(e){var s=this;if(e){s.buffer+=s.decoder.decode(e,{stream:true})}function t(){var e=s.buffer;var t=0;while(t<e.length&&e[t]!=="\r"&&e[t]!=="\n"){++t}var i=e.substr(0,t);if(e[t]==="\r"){++t}if(e[t]==="\n"){++t}s.buffer=e.substr(t);return i}function i(e){var n=new Ss;Es(e,function(e,t){switch(e){case"id":n.set(e,t);break;case"width":n.percent(e,t);break;case"lines":n.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(i.length!==2){break}var s=new Ss;s.percent("x",i[0]);s.percent("y",i[1]);if(!s.has("x")||!s.has("y")){break}n.set(e+"X",s.get("x"));n.set(e+"Y",s.get("y"));break;case"scroll":n.alt(e,t,["up"]);break}},/=/,/\s/);if(n.has("id")){var t=new(s.vttjs.VTTRegion||s.window.VTTRegion);t.width=n.get("width",100);t.lines=n.get("lines",3);t.regionAnchorX=n.get("regionanchorX",0);t.regionAnchorY=n.get("regionanchorY",100);t.viewportAnchorX=n.get("viewportanchorX",0);t.viewportAnchorY=n.get("viewportanchorY",100);t.scroll=n.get("scroll","");s.onregion&&s.onregion(t);s.regionList.push({id:n.get("id"),region:t})}}function n(e){var i=new Ss;Es(e,function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",Ts(t));break}},/[^\d]:/,/,/);s.ontimestampmap&&s.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function r(e){if(e.match(/X-TIMESTAMP-MAP/)){Es(e,function(e,t){switch(e){case"X-TIMESTAMP-MAP":n(t);break}},/=/)}else{Es(e,function(e,t){switch(e){case"Region":i(t);break}},/:/)}}try{var a;if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer)){return this}a=t();var o=a.match(/^WEBVTT([ \t].*)?$/);if(!o||!o[0]){throw new bs(bs.Errors.BadSignature)}s.state="HEADER"}var l=false;while(s.buffer){if(!/\r\n|\n/.test(s.buffer)){return this}if(!l){a=t()}else{l=false}switch(s.state){case"HEADER":if(/:/.test(a)){r(a)}else if(!a){s.state="ID"}continue;case"NOTE":if(!a){s.state="ID"}continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){s.state="NOTE";break}if(!a){continue}s.cue=new(s.vttjs.VTTCue||s.window.VTTCue)(0,0,"");try{s.cue.align="center"}catch(e){s.cue.align="middle"}s.state="CUE";if(a.indexOf("--\x3e")===-1){s.cue.id=a;continue}case"CUE":try{ws(a,s.cue,s.regionList)}catch(e){s.reportOrThrowError(e);s.cue=null;s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":var c=a.indexOf("--\x3e")!==-1;if(!a||c&&(l=true)){s.oncue&&s.oncue(s.cue);s.cue=null;s.state="ID";continue}if(s.cue.text){s.cue.text+="\n"}s.cue.text+=a.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":if(!a){s.state="ID"}continue}}}catch(e){s.reportOrThrowError(e);if(s.state==="CUETEXT"&&s.cue&&s.oncue){s.oncue(s.cue)}s.cue=null;s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{t.buffer+=t.decoder.decode();if(t.cue||t.state==="HEADER"){t.buffer+="\n\n";t.parse()}if(t.state==="INITIAL"){throw new bs(bs.Errors.BadSignature)}}catch(e){t.reportOrThrowError(e)}t.onflush&&t.onflush();return this}};var Vs=Bs;var $s="auto";var Hs={"":1,lr:1,rl:1};var Gs={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function zs(e){if(typeof e!=="string"){return false}var t=Hs[e.toLowerCase()];return t?e.toLowerCase():false}function Ws(e){if(typeof e!=="string"){return false}var t=Gs[e.toLowerCase()];return t?e.toLowerCase():false}function Ys(e,t,i){this.hasBeenReset=false;var s="";var n=false;var r=e;var a=t;var o=i;var l=null;var c="";var u=true;var d="auto";var h="start";var f="auto";var p="auto";var m=100;var g="center";Object.defineProperties(this,{id:{enumerable:true,get:function(){return s},set:function(e){s=""+e}},pauseOnExit:{enumerable:true,get:function(){return n},set:function(e){n=!!e}},startTime:{enumerable:true,get:function(){return r},set:function(e){if(typeof e!=="number"){throw new TypeError("Start time must be set to a number.")}r=e;this.hasBeenReset=true}},endTime:{enumerable:true,get:function(){return a},set:function(e){if(typeof e!=="number"){throw new TypeError("End time must be set to a number.")}a=e;this.hasBeenReset=true}},text:{enumerable:true,get:function(){return o},set:function(e){o=""+e;this.hasBeenReset=true}},region:{enumerable:true,get:function(){return l},set:function(e){l=e;this.hasBeenReset=true}},vertical:{enumerable:true,get:function(){return c},set:function(e){var t=zs(e);if(t===false){throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.")}c=t;this.hasBeenReset=true}},snapToLines:{enumerable:true,get:function(){return u},set:function(e){u=!!e;this.hasBeenReset=true}},line:{enumerable:true,get:function(){return d},set:function(e){if(typeof e!=="number"&&e!==$s){throw new SyntaxError("Line: an invalid number or illegal string was specified.")}d=e;this.hasBeenReset=true}},lineAlign:{enumerable:true,get:function(){return h},set:function(e){var t=Ws(e);if(!t){console.warn("lineAlign: an invalid or illegal string was specified.")}else{h=t;this.hasBeenReset=true}}},position:{enumerable:true,get:function(){return f},set:function(e){if(e<0||e>100){throw new Error("Position must be between 0 and 100.")}f=e;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function(){return p},set:function(e){var t=Ws(e);if(!t){console.warn("positionAlign: an invalid or illegal string was specified.")}else{p=t;this.hasBeenReset=true}}},size:{enumerable:true,get:function(){return m},set:function(e){if(e<0||e>100){throw new Error("Size must be between 0 and 100.")}m=e;this.hasBeenReset=true}},align:{enumerable:true,get:function(){return g},set:function(e){var t=Ws(e);if(!t){throw new SyntaxError("align: an invalid or illegal alignment string was specified.")}g=t;this.hasBeenReset=true}}});this.displayState=undefined}Ys.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(Ly,this.text)};var Xs=Ys;var Ks={"":true,up:true};function Qs(e){if(typeof e!=="string"){return false}var t=Ks[e.toLowerCase()];return t?e.toLowerCase():false}function Js(e){return typeof e==="number"&&e>=0&&e<=100}function Zs(){var t=100;var i=3;var s=0;var n=100;var r=0;var a=100;var o="";Object.defineProperties(this,{width:{enumerable:true,get:function(){return t},set:function(e){if(!Js(e)){throw new Error("Width must be between 0 and 100.")}t=e}},lines:{enumerable:true,get:function(){return i},set:function(e){if(typeof e!=="number"){throw new TypeError("Lines must be set to a number.")}i=e}},regionAnchorY:{enumerable:true,get:function(){return n},set:function(e){if(!Js(e)){throw new Error("RegionAnchorX must be between 0 and 100.")}n=e}},regionAnchorX:{enumerable:true,get:function(){return s},set:function(e){if(!Js(e)){throw new Error("RegionAnchorY must be between 0 and 100.")}s=e}},viewportAnchorY:{enumerable:true,get:function(){return a},set:function(e){if(!Js(e)){throw new Error("ViewportAnchorY must be between 0 and 100.")}a=e}},viewportAnchorX:{enumerable:true,get:function(){return r},set:function(e){if(!Js(e)){throw new Error("ViewportAnchorX must be between 0 and 100.")}r=e}},scroll:{enumerable:true,get:function(){return o},set:function(e){var t=Qs(e);if(t===false){console.warn("Scroll: an invalid or illegal string was specified.")}else{o=t}}}})}var en=Zs;var tn=Li(function(e){var t=e.exports={WebVTT:Vs,VTTCue:Xs,VTTRegion:en};Mi.vttjs=t;Mi.WebVTT=t.WebVTT;var i=t.VTTCue;var s=t.VTTRegion;var n=Mi.VTTCue;var r=Mi.VTTRegion;t.shim=function(){Mi.VTTCue=i;Mi.VTTRegion=s};t.restore=function(){Mi.VTTCue=n;Mi.VTTRegion=r};if(!Mi.VTTCue){t.shim()}});tn.WebVTT;tn.VTTCue;tn.VTTRegion;function sn(e,t,i,s,n={}){const r=e.textTracks();n.kind=t;if(i){n.label=i}if(s){n.language=s}n.tech=e;const a=new _.text.TrackClass(n);r.addTrack(a);return a}class T extends g{constructor(i={},e=function(){}){i.reportTouchActivity=false;super(null,i,e);this.onDurationChange_=e=>this.onDurationChange(e);this.trackProgress_=e=>this.trackProgress(e);this.trackCurrentTime_=e=>this.trackCurrentTime(e);this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e);this.disposeSourceHandler_=e=>this.disposeSourceHandler(e);this.queuedHanders_=new Set;this.hasStarted_=false;this.on("playing",function(){this.hasStarted_=true});this.on("loadstart",function(){this.hasStarted_=false});_.names.forEach(e=>{const t=_[e];if(i&&i[t.getterName]){this[t.privateName]=i[t.getterName]}});if(!this.featuresProgressEvents){this.manualProgressOn()}if(!this.featuresTimeupdateEvents){this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(e=>{if(i[`native${e}Tracks`]===false){this[`featuresNative${e}Tracks`]=false}});if(i.nativeCaptions===false||i.nativeTextTracks===false){this.featuresNativeTextTracks=false}else if(i.nativeCaptions===true||i.nativeTextTracks===true){this.featuresNativeTextTracks=true}if(!this.featuresNativeTextTracks){this.emulateTextTracks()}this.preloadTextTracks=i.preloadTextTracks!==false;this.autoRemoteTextTracks_=new _.text.ListClass;this.initTrackListeners();if(!i.nativeControlsForTouch){this.emitTapEvents()}if(this.constructor){this.name_=this.constructor.name||"Unknown Tech"}}triggerSourceset(e){if(!this.isReady_){this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1))}this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_);this.manualProgress=true;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress();this.progressInterval=this.setInterval(m(this,function(){const e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(e===1){this.stopTrackingProgress()}}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Jt(0,0)}bufferedPercent(){return ri(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime_);this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}dispose(){this.clearTracks(fs.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}super.dispose()}clearTracks(e){e=[].concat(e);e.forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;while(i--){const s=t[i];if(e==="text"){this.removeRemoteTextTrack(s)}t.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;while(t--){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){if(e!==undefined){this.error_=new t(e);this.trigger("error")}return this.error_}played(){if(this.hasStarted_){return Jt(0,0)}return Jt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}}initTrackListeners(){fs.names.forEach(e=>{const t=fs[e];const i=()=>{this.trigger(`${e}trackchange`)};const s=this[t.getterName]();s.addEventListener("removetrack",i);s.addEventListener("addtrack",i);this.on("dispose",()=>{s.removeEventListener("removetrack",i);s.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(Ly.WebVTT){return}if(Ny.body.contains(this.el())){if(!this.options_["vtt.js"]&&ee(tn)&&Object.keys(tn).length>0){this.trigger("vttjsloaded");return}const e=Ny.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";e.onload=()=>{this.trigger("vttjsloaded")};e.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",()=>{e.onload=null;e.onerror=null});Ly.WebVTT=true;this.el().parentNode.appendChild(e)}else{this.ready(this.addWebVttScript_)}}emulateTextTracks(){const i=this.textTracks();const e=this.remoteTextTracks();const s=e=>i.addTrack(e.track);const n=e=>i.removeTrack(e.track);e.on("addtrack",s);e.on("removetrack",n);this.addWebVttScript_();const r=()=>this.trigger("texttrackchange");const a=()=>{r();for(let e=0;e<i.length;e++){const t=i[e];t.removeEventListener("cuechange",r);if(t.mode==="showing"){t.addEventListener("cuechange",r)}}};a();i.addEventListener("change",a);i.addEventListener("addtrack",a);i.addEventListener("removetrack",a);this.on("dispose",function(){e.off("addtrack",s);e.off("removetrack",n);i.removeEventListener("change",a);i.removeEventListener("addtrack",a);i.removeEventListener("removetrack",a);for(let e=0;e<i.length;e++){const t=i[e];t.removeEventListener("cuechange",r)}})}addTextTrack(e,t,i){if(!e){throw new Error("TextTrack kind is required but was not provided")}return sn(this,e,t,i)}createRemoteTextTrack(e){const t=h(e,{tech:this});return new ps.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);if(typeof t!=="boolean"){t=false}this.remoteTextTrackEls().addTrackElement_(i);this.remoteTextTracks().addTrack(i.track);if(t===false){this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track))}return i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t);this.remoteTextTracks().removeTrack(e);this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return true}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=mt();if(!this.isReady_||this.paused()){this.queuedHanders_.add(t);this.one("playing",()=>{if(this.queuedHanders_.has(t)){this.queuedHanders_.delete(t);e()}})}else{this.requestNamedAnimationFrame(t,e)}return t}cancelVideoFrameCallback(e){if(this.queuedHanders_.has(e)){this.queuedHanders_.delete(e)}else{this.cancelNamedAnimationFrame(e)}}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return T.canPlayType(e.type)}static isTech(e){return e.prototype instanceof T||e instanceof T||e===T}static registerTech(e,t){if(!T.techs_){T.techs_={}}if(!T.isTech(t)){throw new Error(`Tech ${e} must be a Tech`)}if(!T.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!T.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}e=c(e);T.techs_[e]=t;T.techs_[zt(e)]=t;if(e!=="Tech"){T.defaultTechOrder_.push(e)}return t}static getTech(e){if(!e){return}if(T.techs_&&T.techs_[e]){return T.techs_[e]}e=c(e);if(Ly&&Ly.videojs&&Ly.videojs[e]){d.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);return Ly.videojs[e]}}}_.names.forEach(function(e){const t=_[e];T.prototype[t.getterName]=function(){this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});T.prototype.featuresVolumeControl=true;T.prototype.featuresMuteControl=true;T.prototype.featuresFullscreenResize=false;T.prototype.featuresPlaybackRate=false;T.prototype.featuresProgressEvents=false;T.prototype.featuresSourceset=false;T.prototype.featuresTimeupdateEvents=false;T.prototype.featuresNativeTextTracks=false;T.prototype.featuresVideoFrameCallback=false;T.withSourceHandlers=function(r){r.registerSourceHandler=function(e,t){let i=r.sourceHandlers;if(!i){i=r.sourceHandlers=[]}if(t===undefined){t=i.length}i.splice(t,0,e)};r.canPlayType=function(t){const i=r.sourceHandlers||[];let s;for(let e=0;e<i.length;e++){s=i[e].canPlayType(t);if(s){return s}}return""};r.selectSourceHandler=function(t,i){const s=r.sourceHandlers||[];let n;for(let e=0;e<s.length;e++){n=s[e].canHandleSource(t,i);if(n){return s[e]}}return null};r.canPlaySource=function(e,t){const i=r.selectSourceHandler(e,t);if(i){return i.canHandleSource(e,t)}return""};const e=["seekable","seeking","duration"];e.forEach(function(e){const t=this[e];if(typeof t!=="function"){return}this[e]=function(){if(this.sourceHandler_&&this.sourceHandler_[e]){return this.sourceHandler_[e].apply(this.sourceHandler_,arguments)}return t.apply(this,arguments)}},r.prototype);r.prototype.setSource=function(e){let t=r.selectSourceHandler(e,this.options_);if(!t){if(r.nativeSourceHandler){t=r.nativeSourceHandler}else{d.error("No source handler found for the current source.")}}this.disposeSourceHandler();this.off("dispose",this.disposeSourceHandler_);if(t!==r.nativeSourceHandler){this.currentSource_=e}this.sourceHandler_=t.handleSource(e,this,this.options_);this.one("dispose",this.disposeSourceHandler_)};r.prototype.disposeSourceHandler=function(){if(this.currentSource_){this.clearTracks(["audio","video"]);this.currentSource_=null}this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose()}this.sourceHandler_=null}}};g.registerComponent("Tech",T);T.registerTech("Tech",T);T.defaultTechOrder_=[];const nn={};const rn={};const an={};function on(e,t){nn[e]=nn[e]||[];nn[e].push(t)}function ln(e,t,i){e.setTimeout(()=>bn(t,nn[t.type],i,e),1)}function cn(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function un(e,t,i){return e.reduceRight(gn(i),t[i]())}function dn(e,t,i,s){return t[i](e.reduce(gn(i),s))}function hn(e,t,i,s=null){const n="call"+c(i);const r=e.reduce(gn(n),s);const a=r===an;const o=a?null:t[i](r);yn(e,i,o,a);return o}const fn={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1};const pn={setCurrentTime:1,setMuted:1,setVolume:1};const mn={play:1,pause:1};function gn(i){return(e,t)=>{if(e===an){return an}if(t[i]){return t[i](e)}return e}}function yn(t,i,s,n){for(let e=t.length-1;e>=0;e--){const r=t[e];if(r[i]){r[i](n,s)}}}function _n(e){if(rn.hasOwnProperty(e.id())){delete rn[e.id()]}}function vn(e,t){const i=rn[e.id()];let s=null;if(i===undefined||i===null){s=t(e);rn[e.id()]=[[t,s]];return s}for(let e=0;e<i.length;e++){const[n,r]=i[e];if(n!==t){continue}s=r}if(s===null){s=t(e);i.push([t,s])}return s}function bn(i={},e=[],s,n,r=[],a=false){const[t,...o]=e;if(typeof t==="string"){bn(i,nn[t],s,n,r,a)}else if(t){const l=vn(n,t);if(!l.setSource){r.push(l);return bn(i,o,s,n,r,a)}l.setSource(Object.assign({},i),function(e,t){if(e){return bn(i,o,s,n,r,a)}r.push(l);bn(t,i.type===t.type?o:nn[t.type],s,n,r,a)})}else if(o.length){bn(i,o,s,n,r,a)}else if(a){s(i,r)}else{bn(i,nn["*"],s,n,r,true)}}const Tn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};const Sn=function(e=""){const t=Di(e);const i=Tn[t.toLowerCase()];return i||""};const En=(e,t)=>{if(!t){return""}if(e.cache_.source.src===t&&e.cache_.source.type){return e.cache_.source.type}const i=e.cache_.sources.filter(e=>e.src===t);if(i.length){return i[0].type}const s=e.$$("source");for(let e=0;e<s.length;e++){const n=s[e];if(n.type&&n.src&&n.src===t){return n.type}}return Sn(t)};const wn=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=wn(e);if(Array.isArray(e)){t=t.concat(e)}else if(Z(e)){t.push(e)}});e=t}else if(typeof e==="string"&&e.trim()){e=[In({src:e})]}else if(Z(e)&&typeof e.src==="string"&&e.src&&e.src.trim()){e=[In(e)]}else{e=[]}return e};function In(e){if(!e.type){const t=Sn(e.src);if(t){e.type=t}}return e}var Cn='<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>';const kn=be?10009:Te?461:8;const An={codes:{play:415,pause:19,ff:417,rw:412,back:kn},names:{415:"play",19:"pause",417:"ff",412:"rw",[kn]:"back"},isEventKey(e,t){t=t.toLowerCase();if(this.names[e.keyCode]&&this.names[e.keyCode]===t){return true}return false},getEventName(e){if(this.names[e.keyCode]){return this.names[e.keyCode]}else if(this.codes[e.code]){const t=this.codes[e.code];return this.names[t]}return null}};const Dn=5;class xn extends Pt{constructor(e){super();this.player_=e;this.focusableComponents=[];this.isListening_=false;this.isPaused_=false;this.onKeyDown_=this.onKeyDown_.bind(this);this.lastFocusedComponent_=null}start(){if(this.isListening_){return}this.player_.on("keydown",this.onKeyDown_);this.player_.on("modalKeydown",this.onKeyDown_);this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])});this.player_.on("modalclose",()=>{this.refocusComponent()});this.player_.on("focusin",this.handlePlayerFocus_.bind(this));this.player_.on("focusout",this.handlePlayerBlur_.bind(this));this.isListening_=true;if(this.player_.errorDisplay){this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents();if(this.focusableComponents.length){if(this.focusableComponents.length>1){this.focusableComponents[1].focus()}else{this.focusableComponents[0].focus()}}})}}stop(){this.player_.off("keydown",this.onKeyDown_);this.isListening_=false}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_){return}t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(An.isEventKey(t,"play")||An.isEventKey(t,"pause")||An.isEventKey(t,"ff")||An.isEventKey(t,"rw")){t.preventDefault();const s=An.getEventName(t);this.performMediaAction_(s)}else if(An.isEventKey(t,"Back")&&e.target&&e.target.closeable()){t.preventDefault();e.target.close()}}performMediaAction_(e){if(this.player_){switch(e){case"play":if(this.player_.paused()){this.player_.play()}break;case"pause":if(!this.player_.paused()){this.player_.pause()}break;case"ff":this.userSeek_(this.player_.currentTime()+Dn);break;case"rw":this.userSeek_(this.player_.currentTime()-Dn);break}}}userSeek_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(e)}pause(){this.isPaused_=true}resume(){this.isPaused_=false}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const s=this.getCurrentComponent(e.target);if(t){i=Boolean(t.closest(".video-js"));if(t.classList.contains("vjs-text-track-settings")&&!this.isPaused_){this.searchForTrackSelect_()}}if(!e.currentTarget.contains(e.relatedTarget)&&!i||!t){if(s&&s.name()==="CloseButton"){this.refocusComponent()}else{this.pause();if(s&&s.el()){this.lastFocusedComponent_=s}}}}handlePlayerFocus_(){if(this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()){this.resume()}}updateFocusableComponents(){const e=this.player_;const n=[];function s(e){for(const t of e){if(t.hasOwnProperty("el_")&&t.getIsFocusable()&&t.getIsAvailableToBeFocused(t.el())){n.push(t)}if(t.hasOwnProperty("children_")&&t.children_.length>0){s(t.children_)}}}e.children_.forEach(e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())){n.push(e);return}else if(e.hasOwnProperty("children_")&&e.children_.length>0){s(e.children_)}else if(e.hasOwnProperty("items")&&e.items.length>0){s(e.items)}else if(this.findSuitableDOMChild(e)){n.push(e)}}if(e.name_==="ErrorDisplay"&&e.opened_){const t=e.el_.querySelector(".vjs-errors-ok-button-container");if(t){const i=t.querySelectorAll("button");i.forEach((s,e)=>{n.push({name:()=>{return"ModalButton"+(e+1)},el:()=>s,getPositions:()=>{const e=s.getBoundingClientRect();const t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left};const i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}},getIsAvailableToBeFocused:()=>true,getIsFocusable:e=>true,focus:()=>s.focus()})})}}});this.focusableComponents=n;return this.focusableComponents}findSuitableDOMChild(e){function n(t){if(e.getIsFocusable(t)&&e.getIsAvailableToBeFocused(t)){return t}for(let e=0;e<t.children.length;e++){const i=t.children[e];const s=n(i);if(s){return s}}return null}if(e.el()){return n(e.el())}return null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||Ny.activeElement;if(this.focusableComponents.length){for(const i of this.focusableComponents){if(i.el()===t){return i}}}}add(e){const t=[...this.focusableComponents];if(e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())){t.push(e)}this.focusableComponents=t;this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(t){for(let e=0;e<this.focusableComponents.length;e++){if(this.focusableComponents[e].name()===t.name()){this.focusableComponents.splice(e,1);this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}}clear(){if(this.focusableComponents.length>0){this.focusableComponents=[];this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}}move(t){const i=this.getCurrentComponent();if(!i){return}const s=i.getPositions();const e=this.focusableComponents.filter(e=>e!==i&&this.isInDirection_(s.boundingClientRect,e.getPositions().boundingClientRect,t));const n=this.findBestCandidate_(s.center,e,t);if(n){this.focus(n)}else{this.trigger({type:"endOfFocusableComponents",direction:t,focusedComponent:i})}}findBestCandidate_(e,t,i){let s=Infinity;let n=null;for(const r of t){const a=r.getPositions().center;const o=this.calculateDistance_(e,a,i);if(o<s){s=o;n=r}}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return false}}refocusComponent(){if(this.lastFocusedComponent_){if(!this.player_.userActive()){this.player_.userActive(true)}this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++){if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}}else{this.focus(this.updateFocusableComponents()[0])}}focus(e){if(typeof e!=="object"){return}if(e.getIsAvailableToBeFocused(e.el())){e.focus()}else if(this.findSuitableDOMChild(e)){this.findSuitableDOMChild(e).focus()}}calculateDistance_(e,t,i){const s=Math.abs(e.x-t.x);const n=Math.abs(e.y-t.y);let r;switch(i){case"right":case"left":r=s+n*100;break;case"up":r=n*2+s*.5;break;case"down":r=n*5+s;break;default:r=s+n}return r}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents()){if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}}class On extends g{constructor(s,e,t){const i=h({createEl:false},e);super(s,i,t);if(!e.playerOptions.sources||e.playerOptions.sources.length===0){for(let t=0,i=e.playerOptions.techOrder;t<i.length;t++){const n=c(i[t]);let e=T.getTech(n);if(!n){e=g.getComponent(n)}if(e&&e.isSupported()){s.loadTech_(n);break}}}else{s.src(e.playerOptions.sources)}}}g.registerComponent("MediaLoader",On);class Pn extends g{constructor(e,t){super(e,t);if(this.options_.controlText){this.controlText(this.options_.controlText)}this.handleMouseOver_=e=>this.handleMouseOver(e);this.handleMouseOut_=e=>this.handleMouseOut(e);this.handleClick_=e=>this.handleClick(e);this.handleKeyDown_=e=>this.handleKeyDown(e);this.emitTapEvents();this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t);if(e==="button"){d.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`)}i=Object.assign({role:"button"},i);this.tabIndex_=t.tabIndex;const s=p(e,t,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(p("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(e){this.controlTextEl_=p("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_}controlText(e,t=this.el()){if(e===undefined){return this.controlText_||"Need Text"}const i=this.localize(e);this.controlText_=e;Re(this.controlTextEl_,i);if(!this.nonIconControl&&!this.player_.options_.noUITitleAttributes){t.setAttribute("title",i)}}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick_);this.on("keydown",this.handleKeyDown_)}}disable(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){this.el_.removeAttribute("tabIndex")}this.off("mouseover",this.handleMouseOver_);this.off("mouseout",this.handleMouseOut_);this.off(["tap","click"],this.handleClick_);this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}g.registerComponent("ClickableComponent",Pn);class Rn extends Pn{constructor(e,t){super(e,t);this.update();this.update_=e=>this.update(e);e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return p("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e==="undefined"){if(this.$("img")){return this.$("img").crossOrigin}else if(this.player_.tech_&&this.player_.tech_.isReady_){return this.player_.crossOrigin()}return this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null}if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}if(this.$("img")){this.$("img").crossOrigin=e}return}update(e){const t=this.player().poster();this.setSrc(t);if(t){this.show()}else{this.hide()}}setSrc(e){if(!e){this.el_.textContent="";return}if(!this.$("img")){this.el_.appendChild(p("picture",{className:"vjs-poster",tabIndex:-1},{},p("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})))}this.$("img").src=e}handleClick(e){if(!this.player_.controls()){return}if(this.player_.tech(true)){this.player_.tech(true).focus()}if(this.player_.paused()){oi(this.player_.play())}else{this.player_.pause()}}}Rn.prototype.crossorigin=Rn.prototype.crossOrigin;g.registerComponent("PosterImage",Rn);const Ln="#222";const Nn="#ccc";const Mn={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Un(e,t){let i;if(e.length===4){i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]}else if(e.length===7){i=e.slice(1)}else{throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Bn(e,t,i){try{e.style[t]=i}catch(e){return}}function Fn(e){return e?`${e}px`:""}class qn extends g{constructor(s,e,t){super(s,e,t);const i=e=>this.updateDisplay(e);const n=e=>{this.updateDisplayOverlay();this.updateDisplay(e)};s.on("loadstart",e=>this.toggleDisplay(e));s.on("texttrackchange",i);s.on("loadedmetadata",e=>{this.updateDisplayOverlay();this.preselectTrack(e)});s.ready(m(this,function(){if(s.tech_&&s.tech_.featuresNativeTextTracks){this.hide();return}s.on("fullscreenchange",n);s.on("playerresize",n);const e=Ly.screen.orientation||Ly;const t=Ly.screen.orientation?"change":"orientationchange";e.addEventListener(t,n);s.on("dispose",()=>e.removeEventListener(t,n));const i=this.options_.playerOptions.tracks||[];for(let e=0;e<i.length;e++){this.player_.addRemoteTextTrack(i[e],true)}this.preselectTrack()}))}preselectTrack(){const t={captions:1,subtitles:1};const i=this.player_.textTracks();const s=this.player_.cache_.selectedLanguage;let n;let r;let a;for(let e=0;e<i.length;e++){const o=i[e];if(s&&s.enabled&&s.language&&s.language===o.language&&o.kind in t){if(o.kind===s.kind){a=o}else if(!a){a=o}}else if(s&&!s.enabled){a=null;n=null;r=null}else if(o.default){if(o.kind==="descriptions"&&!n){n=o}else if(o.kind in t&&!r){r=o}}}if(a){a.mode="showing"}else if(r){r.mode="showing"}else if(n){n.mode="showing"}}toggleDisplay(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide()}else{this.show()}}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){if(typeof Ly.WebVTT==="function"){Ly.WebVTT.processCues(Ly,[],this.el_)}}updateDisplay(){const t=this.player_.textTracks();const e=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(e){const r=[];for(let e=0;e<t.length;++e){const a=t[e];if(a.mode!=="showing"){continue}r.push(a)}this.updateForTrack(r);return}let i=null;let s=null;let n=t.length;while(n--){const a=t[n];if(a.mode==="showing"){if(a.kind==="descriptions"){i=a}else{s=a}}}if(s){if(this.getAttribute("aria-live")!=="off"){this.setAttribute("aria-live","off")}this.updateForTrack(s)}else if(i){if(this.getAttribute("aria-live")!=="assertive"){this.setAttribute("aria-live","assertive")}this.updateForTrack(i)}if(!Ly.CSS.supports("inset","10px")){const o=this.el_;const l=o.querySelectorAll(".vjs-text-track-cue");const c=this.player_.controlBar.el_.getBoundingClientRect().height;const u=this.player_.el_.getBoundingClientRect().height;o.style="";Bn(o,"position","relative");Bn(o,"height",u-c+"px");Bn(o,"top","unset");if(Se){Bn(o,"bottom",u+"px")}else{Bn(o,"bottom","0px")}if(l.length>0){l.forEach(e=>{if(e.style.inset){const t=e.style.inset.split(" ");if(t.length===3){Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}}})}}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!Ly.CSS.supports("inset-inline: 10px")){return}const e=this.player_.currentWidth();const t=this.player_.currentHeight();const i=e/t;const s=this.player_.videoWidth()/this.player_.videoHeight();let n=0;let r=0;if(Math.abs(i-s)>.1){if(i>s){n=Math.round((e-t*s)/2)}else{r=Math.round((t-e/s)/2)}}Bn(this.el_,"insetInline",Fn(n));Bn(this.el_,"insetBlock",Fn(r))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues();const i=e.activeCues;let s=i.length;while(s--){const n=i[s];if(!n){continue}const r=n.displayState;if(t.color){r.firstChild.style.color=t.color}if(t.textOpacity){Bn(r.firstChild,"color",Un(t.color||"#fff",t.textOpacity))}if(t.backgroundColor){r.firstChild.style.backgroundColor=t.backgroundColor}if(t.backgroundOpacity){Bn(r.firstChild,"backgroundColor",Un(t.backgroundColor||"#000",t.backgroundOpacity))}if(t.windowColor){if(t.windowOpacity){Bn(r,"backgroundColor",Un(t.windowColor,t.windowOpacity))}else{r.style.backgroundColor=t.windowColor}}if(t.edgeStyle){if(t.edgeStyle==="dropshadow"){r.firstChild.style.textShadow=`2px 2px 3px ${Ln}, 2px 2px 4px ${Ln}, 2px 2px 5px ${Ln}`}else if(t.edgeStyle==="raised"){r.firstChild.style.textShadow=`1px 1px ${Ln}, 2px 2px ${Ln}, 3px 3px ${Ln}`}else if(t.edgeStyle==="depressed"){r.firstChild.style.textShadow=`1px 1px ${Nn}, 0 1px ${Nn}, -1px -1px ${Ln}, 0 -1px ${Ln}`}else if(t.edgeStyle==="uniform"){r.firstChild.style.textShadow=`0 0 4px ${Ln}, 0 0 4px ${Ln}, 0 0 4px ${Ln}, 0 0 4px ${Ln}`}}if(t.fontPercent&&t.fontPercent!==1){const a=Ly.parseFloat(r.style.fontSize);r.style.fontSize=a*t.fontPercent+"px";r.style.height="auto";r.style.top="auto"}if(t.fontFamily&&t.fontFamily!=="default"){if(t.fontFamily==="small-caps"){r.firstChild.style.fontVariant="small-caps"}else{r.firstChild.style.fontFamily=Mn[t.fontFamily]}}}}updateForTrack(i){if(!Array.isArray(i)){i=[i]}if(typeof Ly.WebVTT!=="function"||i.every(e=>{return!e.activeCues})){return}const t=[];for(let e=0;e<i.length;++e){const s=i[e];for(let e=0;e<s.activeCues.length;++e){t.push(s.activeCues[e])}}Ly.WebVTT.processCues(Ly,t,this.el_);for(let t=0;t<i.length;++t){const s=i[t];for(let e=0;e<s.activeCues.length;++e){const n=s.activeCues[e].displayState;Me(n,"vjs-text-track-cue","vjs-text-track-cue-"+(s.language?s.language:t));if(s.language){Ve(n,"lang",s.language)}}if(this.player_.textTrackSettings){this.updateDisplayState(s)}}}}g.registerComponent("TextTrackDisplay",qn);class jn extends g{createEl(){const e=this.player_.isAudio();const t=this.localize(e?"Audio Player":"Video Player");const i=p("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])});const s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});s.appendChild(i);return s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}g.registerComponent("LoadingSpinner",jn);class r extends Pn{createEl(e,t={},i={}){e="button";t=Object.assign({className:this.buildCSSClass()},t);i=Object.assign({type:"button"},i);const s=p(e,t,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(p("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}addChild(e,t={}){const i=this.constructor.name;d.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`);return g.prototype.addChild.call(this,e,t)}enable(){super.enable();this.el_.removeAttribute("disabled")}disable(){super.disable();this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}g.registerComponent("Button",r);class Vn extends r{constructor(e,t){super(e,t);this.mouseused_=false;this.setIcon("play");this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){oi(t);if(this.player_.tech(true)){this.player_.tech(true).focus()}return}const i=this.player_.getChild("controlBar");const s=i&&i.getChild("playToggle");if(!s){this.player_.tech(true).focus();return}const n=()=>s.focus();if(ai(t)){t.then(n,()=>{})}else{this.setTimeout(n,1)}}handleKeyDown(e){this.mouseused_=false;super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=true}}Vn.prototype.controlText_="Play Video";g.registerComponent("BigPlayButton",Vn);class $n extends r{constructor(e,t){super(e,t);this.setIcon("cancel");this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:false})}handleKeyDown(e){if(e.key==="Escape"){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}g.registerComponent("CloseButton",$n);class Hn extends r{constructor(e,t={}){super(e,t);t.replay=t.replay===undefined||t.replay;this.setIcon("play");this.on(e,"play",e=>this.handlePlay(e));this.on(e,"pause",e=>this.handlePause(e));if(t.replay){this.on(e,"ended",e=>this.handleEnded(e))}}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){if(this.player_.paused()){oi(this.player_.play())}else{this.player_.pause()}}handleSeeked(e){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(e)}else{this.handlePlay(e)}}handlePlay(e){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}Hn.prototype.controlText_="Play";g.registerComponent("PlayToggle",Hn);class Gn extends g{constructor(e,t){super(e,t);this.on(e,["timeupdate","ended","seeking"],e=>this.update(e));this.updateTextNode_()}createEl(){const e=this.buildCSSClass();const t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`});const i=p("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});t.appendChild(i);this.contentEl_=p("span",{className:`${e}-display`},{role:"presentation"});t.appendChild(this.contentEl_);return t}dispose(){this.contentEl_=null;this.textNode_=null;super.dispose()}update(e){if(!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"){return}this.updateContent(e)}updateTextNode_(e=0){e=si(e);if(this.formattedTime_===e){return}this.formattedTime_=e;this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_){return}let e=this.textNode_;if(e&&this.contentEl_.firstChild!==e){e=null;d.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")}this.textNode_=Ny.createTextNode(this.formattedTime_);if(!this.textNode_){return}if(e){this.contentEl_.replaceChild(this.textNode_,e)}else{this.contentEl_.appendChild(this.textNode_)}})}updateContent(e){}}Gn.prototype.labelText_="Time";Gn.prototype.controlText_="Time";g.registerComponent("TimeDisplay",Gn);class zn extends Gn{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;if(this.player_.ended()){t=this.player_.duration()}else{t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(t)}}zn.prototype.labelText_="Current Time";zn.prototype.controlText_="Current Time";g.registerComponent("CurrentTimeDisplay",zn);class Wn extends Gn{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i);this.on(e,"loadstart",i);this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Wn.prototype.labelText_="Duration";Wn.prototype.controlText_="Duration";g.registerComponent("DurationDisplay",Wn);class Yn extends g{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":true});const t=super.createEl("div");const i=super.createEl("span",{textContent:"/"});t.appendChild(i);e.appendChild(t);return e}}g.registerComponent("TimeDivider",Yn);class Xn extends Gn{constructor(e,t){super(e,t);this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();if(this.options_.displayNegative!==false){e.insertBefore(p("span",{},{"aria-hidden":true},"-"),this.contentEl_)}return e}updateContent(e){if(typeof this.player_.duration()!=="number"){return}let t;if(this.player_.ended()){t=0}else if(this.player_.remainingTimeDisplay){t=this.player_.remainingTimeDisplay()}else{t=this.player_.remainingTime()}this.updateTextNode_(t)}}Xn.prototype.labelText_="Remaining Time";Xn.prototype.controlText_="Remaining Time";g.registerComponent("RemainingTimeDisplay",Xn);class Kn extends g{constructor(e,t){super(e,t);this.updateShowing();this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=p("div",{className:"vjs-live-display"},{"aria-live":"off"});this.contentEl_.appendChild(p("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`}));this.contentEl_.appendChild(Ny.createTextNode(this.localize("LIVE")));e.appendChild(this.contentEl_);return e}dispose(){this.contentEl_=null;super.dispose()}updateShowing(e){if(this.player().duration()===Infinity){this.show()}else{this.hide()}}}g.registerComponent("LiveDisplay",Kn);class Qn extends r{constructor(e,t){super(e,t);this.updateLiveEdgeStatus();if(this.player_.liveTracker){this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e);this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",e);this.textEl_=p("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});e.appendChild(this.textEl_);return e}updateLiveEdgeStatus(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",true);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",false);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}this.textEl_=null;super.dispose()}}Qn.prototype.controlText_="Seek to live, currently playing live";g.registerComponent("SeekToLive",Qn);function Jn(e,t,i){e=Number(e);return Math.min(i,Math.max(t,isNaN(e)?t:e))}var Zn=Object.freeze({__proto__:null,clamp:Jn});class er extends g{constructor(e,t){super(e,t);this.handleMouseDown_=e=>this.handleMouseDown(e);this.handleMouseUp_=e=>this.handleMouseUp(e);this.handleKeyDown_=e=>this.handleKeyDown(e);this.handleClick_=e=>this.handleClick(e);this.handleMouseMove_=e=>this.handleMouseMove(e);this.update_=e=>this.update(e);this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown_);this.on("touchstart",this.handleMouseDown_);this.on("keydown",this.handleKeyDown_);this.on("click",this.handleClick_);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true}disable(){if(!this.enabled()){return}const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_);this.off("touchstart",this.handleMouseDown_);this.off("keydown",this.handleKeyDown_);this.off("click",this.handleClick_);this.off(this.player_,"controlsvisible",this.update_);this.off(e,"mousemove",this.handleMouseMove_);this.off(e,"mouseup",this.handleMouseUp_);this.off(e,"touchmove",this.handleMouseMove_);this.off(e,"touchend",this.handleMouseUp_);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false}createEl(e,t={},i={}){t.className=t.className+" vjs-slider";t=Object.assign({tabIndex:0},t);i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i);return super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;if(e.type==="mousedown"){e.preventDefault()}if(e.type==="touchstart"&&!de){e.preventDefault()}He();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(t,"mousemove",this.handleMouseMove_);this.on(t,"mouseup",this.handleMouseUp_);this.on(t,"touchmove",this.handleMouseMove_);this.on(t,"touchend",this.handleMouseUp_);this.handleMouseMove(e,true)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Ge();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(t,"mousemove",this.handleMouseMove_);this.off(t,"mouseup",this.handleMouseUp_);this.off(t,"touchmove",this.handleMouseMove_);this.off(t,"touchend",this.handleMouseUp_);this.update()}update(){if(!this.el_||!this.bar){return}const t=this.getProgress();if(t===this.progress_){return t}this.progress_=t;this.requestNamedAnimationFrame("Slider#update",()=>{const e=this.vertical()?"height":"width";this.bar.el().style[e]=(t*100).toFixed(2)+"%"});return t}getProgress(){return Number(Jn(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Ye(this.el_,e);if(this.vertical()){return t.y}return t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation;const i=t&&t.enabled;const s=t&&t.horizontalSeek;if(i){if(s&&e.key==="ArrowLeft"||!s&&e.key==="ArrowDown"){e.preventDefault();e.stopPropagation();this.stepBack()}else if(s&&e.key==="ArrowRight"||!s&&e.key==="ArrowUp"){e.preventDefault();e.stopPropagation();this.stepForward()}else{super.handleKeyDown(e)}}else if(e.key==="ArrowLeft"||e.key==="ArrowDown"){e.preventDefault();e.stopPropagation();this.stepBack()}else if(e.key==="ArrowUp"||e.key==="ArrowRight"){e.preventDefault();e.stopPropagation();this.stepForward()}else{super.handleKeyDown(e)}}handleClick(e){e.stopPropagation();e.preventDefault()}vertical(e){if(e===undefined){return this.vertical_||false}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}}}g.registerComponent("Slider",er);const tr=(e,t)=>Jn(e/t*100,0,100).toFixed(2)+"%";class ir extends g{constructor(e,t){super(e,t);this.partEls_=[];this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"});const t=p("span",{className:"vjs-control-text"});const i=p("span",{textContent:this.localize("Loaded")});const s=Ny.createTextNode(": ");this.percentageEl_=p("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});e.appendChild(t);t.appendChild(i);t.appendChild(s);t.appendChild(this.percentageEl_);return e}dispose(){this.partEls_=null;this.percentageEl_=null;super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker;const i=this.player_.buffered();const t=e&&e.isLive()?e.seekableEnd():this.player_.duration();const s=this.player_.bufferedEnd();const n=this.partEls_;const r=tr(s,t);if(this.percent_!==r){this.el_.style.width=r;Re(this.percentageEl_,r);this.percent_=r}for(let t=0;t<i.length;t++){const a=i.start(t);const o=i.end(t);let e=n[t];if(!e){e=this.el_.appendChild(p());n[t]=e}if(e.dataset.start===a&&e.dataset.end===o){continue}e.dataset.start=a;e.dataset.end=o;e.style.left=tr(a,s);e.style.width=tr(o-a,s)}for(let e=n.length;e>i.length;e--){this.el_.removeChild(n[e-1])}n.length=i.length})}}g.registerComponent("LoadProgressBar",ir);class sr extends g{constructor(e,t){super(e,t);this.update=At(m(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=We(this.el_);const n=ze(this.player_.el());const r=e.width*t;if(!n||!s){return}let a=e.left-n.left+r;let o=e.width-r+(n.right-e.right);if(!o){o=e.width-r;a=r}let l=s.width/2;if(a<l){l+=l-a}else if(o<l){l=o}if(l<0){l=0}else if(l>s.width){l=s.width}l=Math.round(l);this.el_.style.right=`-${l}px`;this.write(i)}write(e){Re(this.el_,e)}updateTime(n,r,a,o){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let e;const t=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const i=this.player_.liveTracker.liveWindow();const s=i-r*i;e=(s<1?"":"-")+si(s,i)}else{e=si(a,t)}this.update(n,r,e);if(o){o()}})}}g.registerComponent("TimeTooltip",sr);class nr extends g{constructor(e,t){super(e,t);this.setIcon("circle");this.update=At(m(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i){return}const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,s)}}nr.prototype.options_={children:[]};if(!f&&!ae){nr.prototype.options_.children.push("timeTooltip")}g.registerComponent("PlayProgressBar",nr);class rr extends g{constructor(e,t){super(e,t);this.update=At(m(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}rr.prototype.options_={children:["timeTooltip"]};g.registerComponent("MouseTimeDisplay",rr);const ar=5;const or=12;class lr extends er{constructor(e,t){super(e,t);this.setEventHandlers_()}setEventHandlers_(){this.update_=m(this,this.update);this.update=At(this.update_,kt);this.on(this.player_,["durationchange","timeupdate"],this.update);this.on(this.player_,["ended"],this.update_);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.enableIntervalHandler_=e=>this.enableInterval_(e);this.disableIntervalHandler_=e=>this.disableInterval_(e);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in Ny&&"visibilityState"in Ny){this.on(Ny,"visibilitychange",this.toggleVisibility_)}}toggleVisibility_(e){if(Ny.visibilityState==="hidden"){this.cancelNamedAnimationFrame("SeekBar#update");this.cancelNamedAnimationFrame("Slider#update");this.disableInterval_(e)}else{if(!this.player_.ended()&&!this.player_.paused()){this.enableInterval_()}this.update()}}enableInterval_(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,kt)}disableInterval_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"){return}if(!this.updateInterval){return}this.clearInterval(this.updateInterval);this.updateInterval=null}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(Ny.visibilityState==="hidden"){return}const s=super.update();this.requestNamedAnimationFrame("SeekBar#update",()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_();const t=this.player_.liveTracker;let i=this.player_.duration();if(t&&t.isLive()){i=this.player_.liveTracker.liveCurrentTime()}if(this.percent_!==s){this.el_.setAttribute("aria-valuenow",(s*100).toFixed(2));this.percent_=s}if(this.currentTime_!==e||this.duration_!==i){this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[si(e,i),si(i,i)],"{1} of {2}"));this.currentTime_=e;this.duration_=i}if(this.bar){this.bar.update(ze(this.el()),this.getProgress())}});return s}userSeek_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;if(i&&i.isLive()){t=(e-i.seekableStart())/i.liveWindow();if(i.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return t}handleMouseDown(e){if(!et(e)){return}e.stopPropagation();this.videoWasPlaying=!this.player_.paused();this.player_.pause();super.handleMouseDown(e)}handleMouseMove(e,t=false){if(!et(e)||isNaN(this.player_.duration())){return}if(!t&&!this.player_.scrubbing()){this.player_.scrubbing(true)}let i;const s=this.calculateDistance(e);const n=this.player_.liveTracker;if(!n||!n.isLive()){i=s*this.player_.duration();if(i===this.player_.duration()){i=i-.1}}else{if(s>=.99){n.seekToLiveEdge();return}const r=n.seekableStart();const a=n.liveCurrentTime();i=r+s*n.liveWindow();if(i>=a){i=a}if(i<=r){i=r+.1}if(i===Infinity){return}}this.userSeek_(i);if(this.player_.options_.enableSmoothSeeking){this.update()}}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.hide()}handleMouseUp(e){super.handleMouseUp(e);if(e){e.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){oi(this.player_.play())}else{this.update_()}}stepForward(){this.userSeek_(this.player_.currentTime()+ar)}stepBack(){this.userSeek_(this.player_.currentTime()-ar)}handleAction(e){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter"){e.preventDefault();e.stopPropagation();this.handleAction(e)}else if(e.key==="Home"){e.preventDefault();e.stopPropagation();this.userSeek_(0)}else if(e.key==="End"){e.preventDefault();e.stopPropagation();if(t&&t.isLive()){this.userSeek_(t.liveCurrentTime())}else{this.userSeek_(this.player_.duration())}}else if(/^[0-9]$/.test(e.key)){e.preventDefault();e.stopPropagation();const i=parseInt(e.key,10)*.1;if(t&&t.isLive()){this.userSeek_(t.seekableStart()+t.liveWindow()*i)}else{this.userSeek_(this.player_.duration()*i)}}else if(e.key==="PageDown"){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()-ar*or)}else if(e.key==="PageUp"){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()+ar*or)}else{super.handleKeyDown(e)}}dispose(){this.disableInterval_();this.off(this.player_,["durationchange","timeupdate"],this.update);this.off(this.player_,["ended"],this.update_);if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.update)}this.off(this.player_,["playing"],this.enableIntervalHandler_);this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in Ny&&"visibilityState"in Ny){this.off(Ny,"visibilitychange",this.toggleVisibility_)}super.dispose()}}lr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!f&&!ae){lr.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}g.registerComponent("SeekBar",lr);class cr extends g{constructor(e,t){super(e,t);this.handleMouseMove=At(m(this,this.handleMouseMove),kt);this.throttledHandleMouseSeek=At(m(this,this.handleMouseSeek),kt);this.handleMouseUpHandler_=e=>this.handleMouseUp(e);this.handleMouseDownHandler_=e=>this.handleMouseDown(e);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t){return}const i=t.getChild("playProgressBar");const s=t.getChild("mouseTimeDisplay");if(!i&&!s){return}const n=t.el();const r=We(n);let a=Ye(n,e).x;a=Jn(a,0,1);if(s){s.update(r,a)}if(i){i.update(r,t.getProgress())}}handleMouseSeek(e){const t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}}enabled(){return this.enabled_}disable(){this.children().forEach(e=>e.disable&&e.disable());if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDownHandler_);this.off(this.el_,"mousemove",this.handleMouseMove);this.removeListenersAddedOnMousedownAndTouchstart();this.addClass("disabled");this.enabled_=false;if(this.player_.scrubbing()){const e=this.getChild("seekBar");this.player_.scrubbing(false);if(e.videoWasPlaying){oi(this.player_.play())}}}enable(){this.children().forEach(e=>e.enable&&e.enable());if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDownHandler_);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek);this.off(e,"touchmove",this.throttledHandleMouseSeek);this.off(e,"mouseup",this.handleMouseUpHandler_);this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument;const i=this.getChild("seekBar");if(i){i.handleMouseDown(e)}this.on(t,"mousemove",this.throttledHandleMouseSeek);this.on(t,"touchmove",this.throttledHandleMouseSeek);this.on(t,"mouseup",this.handleMouseUpHandler_);this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");if(t){t.handleMouseUp(e)}this.removeListenersAddedOnMousedownAndTouchstart()}}cr.prototype.options_={children:["seekBar"]};g.registerComponent("ProgressControl",cr);class ur extends r{constructor(e,t){super(e,t);this.setIcon("picture-in-picture-enter");this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e));this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e));this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange());this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){const e=this.player_.currentType().substring(0,5)==="audio";const t=e||this.player_.audioPosterMode()||this.player_.audioOnlyMode();if(!t){this.show();return}if(this.player_.isInPictureInPicture()){this.player_.exitPictureInPicture()}this.hide()}handlePictureInPictureEnabledChange(){if(Ny.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===false||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in Ly){this.enable()}else{this.disable()}}handlePictureInPictureChange(e){if(this.player_.isInPictureInPicture()){this.setIcon("picture-in-picture-exit");this.controlText("Exit Picture-in-Picture")}else{this.setIcon("picture-in-picture-enter");this.controlText("Picture-in-Picture")}this.handlePictureInPictureEnabledChange()}handleClick(e){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}}show(){if(typeof Ny.exitPictureInPicture!=="function"){return}super.show()}}ur.prototype.controlText_="Picture-in-Picture";g.registerComponent("PictureInPictureToggle",ur);class dr extends r{constructor(e,t){super(e,t);this.setIcon("fullscreen-enter");this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e));if(Ny[e.fsApi_.fullscreenEnabled]===false){this.disable()}}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){if(this.player_.isFullscreen()){this.controlText("Exit Fullscreen");this.setIcon("fullscreen-exit")}else{this.controlText("Fullscreen");this.setIcon("fullscreen-enter")}}handleClick(e){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}}}dr.prototype.controlText_="Fullscreen";g.registerComponent("FullscreenToggle",dr);const hr=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class fr extends g{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",e);e.appendChild(super.createEl("span",{className:"vjs-control-text"}));return e}}g.registerComponent("VolumeLevel",fr);class pr extends g{constructor(e,t){super(e,t);this.update=At(m(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(t,i,e,s){if(!e){const n=ze(this.el_);const r=ze(this.player_.el());const a=t.width*i;if(!r||!n){return}const o=t.left-r.left+a;const l=t.width-a+(r.right-t.right);let e=n.width/2;if(o<e){e+=e-o}else if(l<e){e=l}if(e<0){e=0}else if(e>n.width){e=n.width}this.el_.style.right=`-${e}px`}this.write(`${s}%`)}write(e){Re(this.el_,e)}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0));if(n){n()}})}}g.registerComponent("VolumeLevelTooltip",pr);class mr extends g{constructor(e,t){super(e,t);this.update=At(m(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,()=>{if(i){this.el_.style.bottom=`${e.height*t}px`}else{this.el_.style.left=`${e.width*t}px`}})}}mr.prototype.options_={children:["volumeLevelTooltip"]};g.registerComponent("MouseVolumeLevelDisplay",mr);class gr extends er{constructor(e,t){super(e,t);this.on("slideractive",e=>this.updateLastVolume_(e));this.on(e,"volumechange",e=>this.updateARIAAttributes(e));e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){if(!et(e)){return}super.handleMouseDown(e)}handleMouseMove(t){const i=this.getChild("mouseVolumeLevelDisplay");if(i){const s=this.el();const n=ze(s);const r=this.vertical();let e=Ye(s,t);e=r?e.y:e.x;e=Jn(e,0,1);i.update(n,e,r)}if(!et(t)){return}this.checkMuted();this.player_.volume(this.calculateDistance(t))}checkMuted(){if(this.player_.muted()){this.player_.muted(false)}}getPercent(){if(this.player_.muted()){return 0}return this.player_.volume()}stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t);this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{if(this.player_.volume()===0){this.player_.lastVolume_(e)}})}}gr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!f&&!ae){gr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay")}gr.prototype.playerEvent="volumechange";g.registerComponent("VolumeBar",gr);class yr extends g{constructor(e,t={}){t.vertical=t.vertical||false;if(typeof t.volumeBar==="undefined"||ee(t.volumeBar)){t.volumeBar=t.volumeBar||{};t.volumeBar.vertical=t.vertical}super(e,t);hr(this,e);this.throttledHandleMouseMove=At(m(this,this.handleMouseMove),kt);this.handleMouseUpHandler_=e=>this.handleMouseUp(e);this.on("mousedown",e=>this.handleMouseDown(e));this.on("touchstart",e=>this.handleMouseDown(e));this.on("mousemove",e=>this.handleMouseMove(e));this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active");this.addClass("vjs-slider-active");this.trigger("slideractive")});this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active");this.removeClass("vjs-slider-active");this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";if(this.options_.vertical){e="vjs-volume-vertical"}return super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove);this.on(t,"touchmove",this.throttledHandleMouseMove);this.on(t,"mouseup",this.handleMouseUpHandler_);this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove);this.off(t,"touchmove",this.throttledHandleMouseMove);this.off(t,"mouseup",this.handleMouseUpHandler_);this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}yr.prototype.options_={children:["volumeBar"]};g.registerComponent("VolumeControl",yr);const _r=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class vr extends r{constructor(e,t){super(e,t);_r(this,e);this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume();const i=this.player_.lastVolume_();if(t===0){const s=i<.1?.1:i;this.player_.volume(s);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}}update(e){this.updateIcon_();this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high");if(f&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(e===0||this.player_.muted()){this.setIcon("volume-mute");t=0}else if(e<.33){this.setIcon("volume-low");t=1}else if(e<.67){this.setIcon("volume-medium");t=2}Ue(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,""));Me(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0;const t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}}}vr.prototype.controlText_="Mute";g.registerComponent("MuteToggle",vr);class br extends g{constructor(e,t={}){if(typeof t.inline!=="undefined"){t.inline=t.inline}else{t.inline=true}if(typeof t.volumeControl==="undefined"||ee(t.volumeControl)){t.volumeControl=t.volumeControl||{};t.volumeControl.vertical=!t.inline}super(e,t);this.handleKeyPressHandler_=e=>this.handleKeyPress(e);this.on(e,["loadstart"],e=>this.volumePanelState_(e));this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e));this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e));this.on("keydown",e=>this.handleKeyPress(e));this.on("mouseover",e=>this.handleMouseOver(e));this.on("mouseout",e=>this.handleMouseOut(e));this.on(this.volumeControl,["slideractive"],this.sliderActive_);this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}}createEl(){let e="vjs-volume-panel-horizontal";if(!this.options_.inline){e="vjs-volume-panel-vertical"}return super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(e){if(e.key==="Escape"){this.muteToggle.focus()}}handleMouseOver(e){this.addClass("vjs-hover");St(Ny,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover");l(Ny,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){if(e.key==="Escape"){this.handleMouseOut()}}}br.prototype.options_={children:["muteToggle","volumeControl"]};g.registerComponent("VolumePanel",br);class Tr extends r{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipForwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`forward-${this.skipTime}`);this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())]));this.show()}else{this.hide()}}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration())){return}const t=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;if(t+this.skipTime<=s){n=t+this.skipTime}else{n=s}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Tr.prototype.controlText_="Skip Forward";g.registerComponent("SkipForward",Tr);class Sr extends r{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipBackwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`replay-${this.skipTime}`);this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())]));this.show()}else{this.hide()}}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()&&i.seekableStart();let n;if(s&&t-this.skipTime<=s){n=s}else if(t>=this.skipTime){n=t-this.skipTime}else{n=0}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Sr.prototype.controlText_="Skip Backward";g.registerComponent("SkipBackward",Sr);class Er extends g{constructor(e,t){super(e,t);if(t){this.menuButton_=t.menuButton}this.focusedChild_=-1;this.on("keydown",e=>this.handleKeyDown(e));this.boundHandleBlur_=e=>this.handleBlur(e);this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){if(!(e instanceof g)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(e){if(!(e instanceof g)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)}removeChild(e){if(typeof e==="string"){e=this.getChild(e)}this.removeEventListenerForItem(e);super.removeChild(e)}addItem(e){const t=this.addChild(e);if(t){this.addEventListenerForItem(t)}}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=p(e,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});t.appendChild(this.contentEl_);St(t,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return t}dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;super.dispose()}handleBlur(e){const t=e.relatedTarget||Ny.activeElement;if(!this.children().some(e=>{return e.el()===t})){const i=this.menuButton_;if(i&&i.buttonPressed_&&t!==i.el().firstChild){i.unpressButton()}}}handleTapClick(t){if(this.menuButton_){this.menuButton_.unpressButton();const e=this.children();if(!Array.isArray(e)){return}const i=e.filter(e=>e.el()===t.target)[0];if(!i){return}if(i.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}}handleKeyDown(e){if(e.key==="ArrowLeft"||e.key==="ArrowDown"){e.preventDefault();e.stopPropagation();this.stepForward()}else if(e.key==="ArrowRight"||e.key==="ArrowUp"){e.preventDefault();e.stopPropagation();this.stepBack()}}stepForward(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_+1}this.focus(e)}stepBack(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_-1}this.focus(e)}focus(e=0){const t=this.children().slice();const i=t.length&&t[0].hasClass("vjs-menu-title");if(i){t.shift()}if(t.length>0){if(e<0){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}}}g.registerComponent("Menu",Er);class wr extends g{constructor(e,t={}){super(e,t);this.menuButton_=new r(e,t);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=r.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_);this.update();this.enabled_=true;const s=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e);this.on(this.menuButton_,"tap",s);this.on(this.menuButton_,"click",s);this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e));this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover");this.menu.show();St(Ny,"keyup",this.handleMenuKeyUp_)});this.on("mouseleave",e=>this.handleMouseLeave(e));this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const e=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=e;this.addChild(e);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide();this.menu.contentEl_.removeAttribute("role")}else{this.show();this.menu.contentEl_.setAttribute("role","menu")}}createMenu(){const t=new Er(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){const e=p("li",{className:"vjs-menu-title",textContent:c(this.options_.title),tabIndex:-1});const i=new g(this.player_,{el:e});t.addItem(i)}this.items=this.createItems();if(this.items){for(let e=0;e<this.items.length;e++){t.addItem(this.items[e])}}return t}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";if(this.options_.inline===true){e+="-inline"}else{e+="-popup"}const t=r.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";if(this.options_.inline===true){e+="-inline"}else{e+="-popup"}return`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave();super.dispose()}handleClick(e){if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}}handleMouseLeave(e){this.removeClass("vjs-hover");l(Ny,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){if(e.key==="Esc"||e.key==="Tab"){if(this.buttonPressed_){this.unpressButton()}if(!e.key==="Tab"){e.preventDefault();this.menuButton_.focus()}}else if(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)){if(!this.buttonPressed_){e.preventDefault();this.pressButton()}}}handleMenuKeyUp(e){if(e.key==="Esc"||e.key==="Tab"){this.removeClass("vjs-hover")}}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){if(e.key==="Esc"||e.key==="Tab"){if(this.buttonPressed_){this.unpressButton()}if(!e.key==="Tab"){e.preventDefault();this.menuButton_.focus()}}}pressButton(){if(this.enabled_){this.buttonPressed_=true;this.menu.show();this.menu.lockShowing();this.menuButton_.el_.setAttribute("aria-expanded","true");if(f&&Oe()){return}this.menu.focus()}}unpressButton(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menu.hide();this.menuButton_.el_.setAttribute("aria-expanded","false")}}disable(){this.unpressButton();this.enabled_=false;this.addClass("vjs-disabled");this.menuButton_.disable()}enable(){this.enabled_=true;this.removeClass("vjs-disabled");this.menuButton_.enable()}}g.registerComponent("MenuButton",wr);class Ir extends wr{constructor(e,t){const i=t.tracks;super(e,t);if(this.items.length<=1){this.hide()}if(!i){return}const s=m(this,this.update);i.addEventListener("removetrack",s);i.addEventListener("addtrack",s);i.addEventListener("labelchange",s);this.player_.on("ready",s);this.player_.on("dispose",function(){i.removeEventListener("removetrack",s);i.removeEventListener("addtrack",s);i.removeEventListener("labelchange",s)})}}g.registerComponent("TrackButton",Ir);class Cr extends Pn{constructor(e,t){super(e,t);this.selectable=t.selectable;this.isSelected_=t.selected||false;this.multiSelectable=t.multiSelectable;this.selected(this.isSelected_);if(this.selectable){if(this.multiSelectable){this.el_.setAttribute("role","menuitemcheckbox")}else{this.el_.setAttribute("role","menuitemradio")}}else{this.el_.setAttribute("role","menuitem")}}createEl(e,t,i){this.nonIconControl=true;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i);const n=p("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});if(this.player_.options_.experimentalSvgIcons){s.appendChild(n)}else{s.replaceChild(n,s.querySelector(".vjs-icon-placeholder"))}return s}handleKeyDown(e){if(!["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)){super.handleKeyDown(e)}}handleClick(e){this.selected(true)}selected(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}}}g.registerComponent("MenuItem",Cr);class kr extends Cr{constructor(e,t){const i=t.track;const s=e.textTracks();t.label=i.label||i.language||"Unknown";t.selected=i.mode==="showing";super(e,t);this.track=i;this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...e)=>{this.handleTracksChange.apply(this,e)};const r=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};e.on(["loadstart","texttrackchange"],n);s.addEventListener("change",n);s.addEventListener("selectedlanguagechange",r);this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n);s.removeEventListener("change",n);s.removeEventListener("selectedlanguagechange",r)});if(s.onchange===undefined){let e;this.on(["tap","click"],function(){if(typeof Ly.Event!=="object"){try{e=new Ly.Event("change")}catch(e){}}if(!e){e=Ny.createEvent("Event");e.initEvent("change",true,true)}s.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track;const i=this.player_.textTracks();super.handleClick(e);if(!i){return}for(let e=0;e<i.length;e++){const s=i[e];if(this.kinds.indexOf(s.kind)===-1){continue}if(s===t){if(s.mode!=="showing"){s.mode="showing"}}else if(s.mode!=="disabled"){s.mode="disabled"}}}handleTracksChange(e){const t=this.track.mode==="showing";if(t!==this.isSelected_){this.selected(t)}}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind){return}this.player_.cache_.selectedLanguage={enabled:true,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null;super.dispose()}}g.registerComponent("TextTrackMenuItem",kr);class Ar extends kr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:false,mode:"disabled"};if(!t.kinds){t.kinds=[t.kind]}if(t.label){t.track.label=t.label}else{t.track.label=t.kinds.join(" and ")+" off"}t.selectable=true;t.multiSelectable=false;super(e,t)}handleTracksChange(e){const i=this.player().textTracks();let s=true;for(let e=0,t=i.length;e<t;e++){const n=i[e];if(this.options_.kinds.indexOf(n.kind)>-1&&n.mode==="showing"){s=false;break}}if(s!==this.isSelected_){this.selected(s)}}handleSelectedLanguageChange(e){const i=this.player().textTracks();let s=true;for(let e=0,t=i.length;e<t;e++){const n=i[e];if(["captions","descriptions","subtitles"].indexOf(n.kind)>-1&&n.mode==="showing"){s=false;break}}if(s){this.player_.cache_.selectedLanguage={enabled:false}}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}}g.registerComponent("OffTextTrackMenuItem",Ar);class Dr extends Ir{constructor(e,t={}){t.tracks=e.textTracks();super(e,t)}createItems(t=[],i=kr){let e;if(this.label_){e=`${this.label_} off`}t.push(new Ar(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e}));this.hideThreshold_+=1;const s=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(let e=0;e<s.length;e++){const n=s[e];if(this.kinds_.indexOf(n.kind)>-1){const r=new i(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});r.addClass(`vjs-${n.kind}-menu-item`);t.push(r)}}return t}}g.registerComponent("TextTrackButton",Dr);class xr extends Cr{constructor(e,t){const i=t.track;const s=t.cue;const n=e.currentTime();t.selectable=true;t.multiSelectable=false;t.label=s.text;t.selected=s.startTime<=n&&n<s.endTime;super(e,t);this.track=i;this.cue=s}handleClick(e){super.handleClick();this.player_.currentTime(this.cue.startTime)}}g.registerComponent("ChaptersTrackMenuItem",xr);class Or extends Dr{constructor(e,t,i){super(e,t,i);this.setIcon("chapters");this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters"){return}const t=this.findChaptersTrack();if(t!==this.track_){this.setTrack(t);super.update()}else if(!this.items||t&&t.cues&&t.cues.length!==this.items.length){super.update()}}setTrack(e){if(this.track_===e){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.removeEventListener("load",this.updateHandler_)}this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}this.track_=e;if(this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.addEventListener("load",this.updateHandler_)}this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}findChaptersTrack(){const t=this.player_.textTracks()||[];for(let e=t.length-1;e>=0;e--){const i=t[e];if(i.kind===this.kind_){return i}}}getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(c(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const i=[];if(!this.track_){return i}const s=this.track_.cues;if(!s){return i}for(let e=0,t=s.length;e<t;e++){const n=s[e];const r=new xr(this.player_,{track:this.track_,cue:n});i.push(r)}return i}}Or.prototype.kind_="chapters";Or.prototype.controlText_="Chapters";g.registerComponent("ChaptersButton",Or);class Pr extends Dr{constructor(e,t,i){super(e,t,i);this.setIcon("audio-description");const s=e.textTracks();const n=m(this,this.handleTracksChange);s.addEventListener("change",n);this.on("dispose",function(){s.removeEventListener("change",n)})}handleTracksChange(e){const i=this.player().textTracks();let s=false;for(let e=0,t=i.length;e<t;e++){const n=i[e];if(n.kind!==this.kind_&&n.mode==="showing"){s=true;break}}if(s){this.disable()}else{this.enable()}}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Pr.prototype.kind_="descriptions";Pr.prototype.controlText_="Descriptions";g.registerComponent("DescriptionsButton",Pr);class Rr extends Dr{constructor(e,t,i){super(e,t,i);this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Rr.prototype.kind_="subtitles";Rr.prototype.controlText_="Subtitles";g.registerComponent("SubtitlesButton",Rr);class Lr extends kr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:false,default:false,mode:"disabled"};t.selectable=false;t.name="CaptionSettingsMenuItem";super(e,t);this.addClass("vjs-texttrack-settings");this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings");super.handleLanguagechange()}}g.registerComponent("CaptionSettingsMenuItem",Lr);class Nr extends Dr{constructor(e,t,i){super(e,t,i);this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){e.push(new Lr(this.player_,{kind:this.kind_}));this.hideThreshold_+=1}return super.createItems(e)}}Nr.prototype.kind_="captions";Nr.prototype.controlText_="Captions";g.registerComponent("CaptionsButton",Nr);class Mr extends kr{createEl(e,t,i){const s=super.createEl(e,t,i);const n=s.querySelector(".vjs-menu-item-text");if(this.options_.track.kind==="captions"){if(this.player_.options_.experimentalSvgIcons){this.setIcon("captions",s)}else{n.appendChild(p("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}n.appendChild(p("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))}return s}}g.registerComponent("SubsCapsMenuItem",Mr);class Ur extends Dr{constructor(e,t={}){super(e,t);this.label_="subtitles";this.setIcon("subtitles");if(["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1){this.label_="captions";this.setIcon("captions")}this.menuButton_.controlText(c(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){e.push(new Lr(this.player_,{kind:this.label_}));this.hideThreshold_+=1}e=super.createItems(e,Mr);return e}}Ur.prototype.kinds_=["captions","subtitles"];Ur.prototype.controlText_="Subtitles";g.registerComponent("SubsCapsButton",Ur);class Br extends Cr{constructor(e,t){const i=t.track;const s=e.audioTracks();t.label=i.label||i.language||"Unknown";t.selected=i.enabled;super(e,t);this.track=i;this.addClass(`vjs-${i.kind}-menu-item`);const n=(...e)=>{this.handleTracksChange.apply(this,e)};s.addEventListener("change",n);this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,i){const s=super.createEl(e,t,i);const n=s.querySelector(".vjs-menu-item-text");if(["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0){n.appendChild(p("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));n.appendChild(p("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))}return s}handleClick(e){super.handleClick(e);this.track.enabled=true;if(this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let e=0;e<t.length;e++){const i=t[e];if(i===this.track){continue}i.enabled=i===this.track}}}handleTracksChange(e){this.selected(this.track.enabled)}}g.registerComponent("AudioTrackMenuItem",Br);class Fr extends Ir{constructor(e,t={}){t.tracks=e.audioTracks();super(e,t);this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(t=[]){this.hideThreshold_=1;const i=this.player_.audioTracks();for(let e=0;e<i.length;e++){const s=i[e];t.push(new Br(this.player_,{track:s,selectable:true,multiSelectable:false}))}return t}}Fr.prototype.controlText_="Audio Track";g.registerComponent("AudioTrackButton",Fr);class qr extends Cr{constructor(e,t){const i=t.rate;const s=parseFloat(i,10);t.label=i;t.selected=s===e.playbackRate();t.selectable=true;t.multiSelectable=false;super(e,t);this.label=i;this.rate=s;this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick();this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}qr.prototype.contentElType="button";g.registerComponent("PlaybackRateMenuItem",qr);class jr extends wr{constructor(e,t){super(e,t);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(e,"loadstart",e=>this.updateVisibility(e));this.on(e,"ratechange",e=>this.updateLabel(e));this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=p("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});e.appendChild(this.labelEl_);return e}dispose(){this.labelEl_=null;super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const t=this.playbackRates();const i=[];for(let e=t.length-1;e>=0;e--){i.push(new qr(this.player(),{rate:t[e]+"x"}))}return i}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}}updateLabel(e){if(this.playbackRateSupported()){this.labelEl_.textContent=this.player().playbackRate()+"x"}}}jr.prototype.controlText_="Playback Rate";g.registerComponent("PlaybackRateMenuButton",jr);class Vr extends g{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){if(!t.className){t.className=this.buildCSSClass()}return super.createEl(e,t,i)}}g.registerComponent("Spacer",Vr);class $r extends Vr{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}}g.registerComponent("CustomControlSpacer",$r);class Hr extends g{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Hr.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};g.registerComponent("ControlBar",Hr);class Gr extends fi{constructor(e,t){super(e,t);this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Gr.prototype.options_=Object.assign({},fi.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});g.registerComponent("ErrorDisplay",Gr);class zr extends g{constructor(e,t={}){super(e,t);this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim();const e=p("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${mt()}`)+"-"+e[1].replace(/\W+/g,"");const i=p("option",{id:t,value:this.localize(e[0]),textContent:e[1]});i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`);return i}));return e}}g.registerComponent("TextTrackSelect",zr);class Wr extends g{constructor(t,e={}){super(t,e);const i=p("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const s=this.options_.selects;for(const n of s){const r=this.options_.selectConfigs[n];const a=r.className;const o=r.id.replace("%s",this.options_.id_);let e=null;const l=`vjs_select_${mt()}`;if(this.options_.type==="colors"){e=p("span",{className:a});const u=p("label",{id:o,className:"vjs-label",textContent:r.label});u.setAttribute("for",l);e.appendChild(u)}const c=new zr(t,{SelectOptions:r.options,legendId:this.options_.legendId,id:l,labelId:o});this.addChild(c);if(this.options_.type==="colors"){e.appendChild(c.el());this.el().appendChild(e)}}}createEl(){const e=p("fieldset",{className:this.options_.className});return e}}g.registerComponent("TextTrackFieldset",Wr);class Yr extends g{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid;const s=new Wr(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const n=new Wr(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const r=new Wr(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r)}createEl(){const e=p("div",{className:"vjs-track-settings-colors"});return e}}g.registerComponent("TextTrackSettingsColors",Yr);class Xr extends g{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid;const s=new Wr(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const n=new Wr(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const r=new Wr(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r)}createEl(){const e=p("div",{className:"vjs-track-settings-font"});return e}}g.registerComponent("TextTrackSettingsFont",Xr);class Kr extends g{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values");const s=new r(e,{controlText:i,className:"vjs-default-button"});s.el().classList.remove("vjs-control","vjs-button");s.el().textContent=this.localize("Reset");this.addChild(s);const n=new r(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button");n.el().textContent=this.localize("Done");this.addChild(n)}createEl(){const e=p("div",{className:"vjs-track-settings-controls"});return e}}g.registerComponent("TrackSettingsControls",Kr);const Qr="vjs-text-track-settings";const Jr=["#000","Black"];const Zr=["#00F","Blue"];const ea=["#0FF","Cyan"];const ta=["#0F0","Green"];const ia=["#F0F","Magenta"];const sa=["#F00","Red"];const na=["#FFF","White"];const ra=["#FF0","Yellow"];const aa=["1","Opaque"];const oa=["0.5","Semi-Transparent"];const la=["0","Transparent"];const ca={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Jr,na,sa,ta,Zr,ra,ia,ea],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[aa,oa,la],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[na,Jr,sa,ta,Zr,ra,ia,ea],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>e==="1.00"?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[aa,oa],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[la,oa,aa],className:"vjs-window-opacity vjs-opacity"}};ca.windowColor.options=ca.backgroundColor.options;function ua(e,t){if(t){e=t(e)}if(e&&e!=="none"){return e}}function da(e,t){const i=e.options[e.options.selectedIndex].value;return ua(i,t)}function ha(t,i,s){if(!i){return}for(let e=0;e<t.options.length;e++){if(ua(t.options[e].value,s)===i){t.selectedIndex=e;break}}}class fa extends fi{constructor(e,t){t.temporary=false;super(e,t);this.updateDisplay=this.updateDisplay.bind(this);this.fill();this.hasBeenOpened_=this.hasBeenFilled_=true;this.renderModalComponents(e);this.endDialog=p("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")});this.el().appendChild(this.endDialog);this.setDefaults();if(t.persistTextTrackSettings===undefined){this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings}this.bindFunctionsToSelectsAndButtons();if(this.options_.persistTextTrackSettings){this.restoreSettings()}}renderModalComponents(e){const t=new Yr(e,{textTrackComponentid:this.id_,selectConfigs:ca,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Xr(e,{textTrackComponentid:this.id_,selectConfigs:ca,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const s=new Kr(e);this.addChild(s)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings();this.close()});this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults();this.updateDisplay()});Q(ca,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null;super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return J(ca,(e,t,i)=>{const s=da(this.$(t.selector),t.parser);if(s!==undefined){e[i]=s}return e},{})}setValues(i){Q(ca,(e,t)=>{ha(this.$(e.selector),i[t],e.parser)})}setDefaults(){Q(ca,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(Ly.localStorage.getItem(Qr))}catch(e){d.warn(e)}if(e){this.setValues(e)}}saveSettings(){if(!this.options_.persistTextTrackSettings){return}const e=this.getValues();try{if(Object.keys(e).length){Ly.localStorage.setItem(Qr,JSON.stringify(e))}else{Ly.localStorage.removeItem(Qr)}}catch(e){d.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}}handleLanguagechange(){this.fill();this.renderModalComponents(this.player_);this.bindFunctionsToSelectsAndButtons()}}g.registerComponent("TextTrackSettings",fa);class pa extends g{constructor(e,t){let i=t.ResizeObserver||Ly.ResizeObserver;if(t.ResizeObserver===null){i=false}const s=h({createEl:!i,reportTouchActivity:false},t);super(e,s);this.ResizeObserver=t.ResizeObserver||Ly.ResizeObserver;this.loadListener_=null;this.resizeObserver_=null;this.debouncedHandler_=Dt(()=>{this.resizeHandler()},100,false,this);if(i){this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_);this.resizeObserver_.observe(e.el())}else{this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow){return}const e=this.debouncedHandler_;let t=this.unloadListener_=function(){l(this,"resize",e);l(this,"unload",t);t=null};St(this.el_.contentWindow,"unload",t);St(this.el_.contentWindow,"resize",e)};this.one("load",this.loadListener_)}}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")}dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;super.dispose()}}g.registerComponent("ResizeManager",pa);const ma={trackingThreshold:20,liveTolerance:15};class ga extends g{constructor(e,t){const i=h(ma,t,{createEl:false});super(e,i);this.trackLiveHandler_=()=>this.trackLive_();this.handlePlay_=e=>this.handlePlay(e);this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e);this.handleSeeked_=e=>this.handleSeeked(e);this.seekToLiveEdge_=e=>this.seekToLiveEdge(e);this.reset_();this.on(this.player_,"durationchange",e=>this.handleDurationchange(e));this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length){return}const t=Number(Ly.performance.now().toFixed(4));const i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t;this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime();const n=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;if(!this.timeupdateSeen_||s===Infinity){r=false}if(r!==this.behindLiveEdge_){this.behindLiveEdge_=r;this.trigger("liveedgechange")}}handleDurationchange(){this.toggleTracking()}toggleTracking(){if(this.player_.duration()===Infinity&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}}startTracking(){if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLiveHandler_,kt);this.trackLive_();this.on(this.player_,["play","pause"],this.trackLiveHandler_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay_);this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)}else{this.on(this.player_,"seeked",this.handleSeeked_)}}handleFirstTimeupdate(){this.timeupdateSeen_=true;this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2;this.nextSeekedFromUser_=false;this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=true;this.timeupdateSeen_=false;this.seekedBehindLive_=false;this.nextSeekedFromUser_=false;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.off(this.player_,["play","pause"],this.trackLiveHandler_);this.off(this.player_,"seeked",this.handleSeeked_);this.off(this.player_,"play",this.handlePlay_);this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_);this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=true}stopTracking(){if(!this.isTracking()){return}this.reset_();this.trigger("liveedgechange")}seekableEnd(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.end(i))}return t.length?t.sort()[t.length-1]:Infinity}seekableStart(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.start(i))}return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();if(e===Infinity){return 0}return e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();if(this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_){this.pastSeekEnd_=0}this.lastSeekEnd_=e;return this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==="number"}seekToLiveEdge(){this.seekedBehindLive_=false;if(this.atLiveEdge()){return}this.nextSeekedFromUser_=false;this.player_.currentTime(this.liveCurrentTime())}dispose(){this.stopTracking();super.dispose()}}g.registerComponent("LiveTracker",ga);class ya extends g{constructor(e,t){super(e,t);this.on("statechanged",e=>this.updateDom_());this.updateDom_()}createEl(){this.els={title:p("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${mt()}`}),description:p("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${mt()}`})};return p("div",{className:"vjs-title-bar"},{},te(this.els))}updateDom_(){const e=this.player_.tech_;const n=e&&e.el_;const r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const t=this.state[e];const i=this.els[e];const s=r[e];Ke(i);if(t){Re(i,t)}if(n){n.removeAttribute(s);if(t){n.setAttribute(s,i.id)}}});if(this.state.title||this.state.description){this.show()}else{this.hide()}}update(e){this.setState(e)}dispose(){const e=this.player_.tech_;const t=e&&e.el_;if(t){t.removeAttribute("aria-labelledby");t.removeAttribute("aria-describedby")}super.dispose();this.els=null}}g.registerComponent("TitleBar",ya);const _a={initialDisplay:4e3,position:[],takeFocus:false};class va extends r{constructor(e,t){t=h(_a,t);super(e,t);this.controlText(t.controlText);this.hide();this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=p("button",{},{type:"button",class:this.buildCSSClass()},p("span"));this.controlTextEl_=e.querySelector("span");return e}show(){super.show();this.addClass("force-display");if(this.options_.takeFocus){this.el().focus({preventScroll:true})}this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display");super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout);super.dispose()}}g.registerComponent("TransientButton",va);const ba=e=>{const t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return true}const i=e.$$("source");const s=[];let n="";if(!i.length){return false}for(let e=0;e<i.length;e++){const r=i[e].src;if(r&&s.indexOf(r)===-1){s.push(r)}}if(!s.length){return false}if(s.length===1){n=s[0]}e.triggerSourceset(n);return true};const Ta=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(true).innerHTML},set(e){const t=Ny.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=Ny.createDocumentFragment();while(t.childNodes.length){i.appendChild(t.childNodes[0])}this.innerText="";Ly.Element.prototype.appendChild.call(this,i);return this.innerHTML}});const Sa=(t,i)=>{let s={};for(let e=0;e<t.length;e++){s=Object.getOwnPropertyDescriptor(t[e],i);if(s&&s.set&&s.get){break}}s.enumerable=true;s.configurable=true;return s};const Ea=e=>Sa([e.el(),Ly.HTMLMediaElement.prototype,Ly.Element.prototype,Ta],"innerHTML");const wa=function(s){const n=s.el();if(n.resetSourceWatch_){return}const t={};const e=Ea(s);const i=i=>(...e)=>{const t=i.apply(n,e);ba(s);return t};["append","appendChild","insertAdjacentHTML"].forEach(e=>{if(!n[e]){return}t[e]=n[e];n[e]=i(t[e])});Object.defineProperty(n,"innerHTML",h(e,{set:i(e.set)}));n.resetSourceWatch_=()=>{n.resetSourceWatch_=null;Object.keys(t).forEach(e=>{n[e]=t[e]});Object.defineProperty(n,"innerHTML",e)};s.one("sourceset",n.resetSourceWatch_)};const Ia=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src")){return Ai(Ly.Element.prototype.getAttribute.call(this,"src"))}return""},set(e){Ly.Element.prototype.setAttribute.call(this,"src",e);return e}});const Ca=e=>Sa([e.el(),Ly.HTMLMediaElement.prototype,Ia],"src");const ka=function(s){if(!s.featuresSourceset){return}const n=s.el();if(n.resetSourceset_){return}const i=Ca(s);const r=n.setAttribute;const t=n.load;Object.defineProperty(n,"src",h(i,{set:e=>{const t=i.set.call(n,e);s.triggerSourceset(n.src);return t}}));n.setAttribute=(e,t)=>{const i=r.call(n,e,t);if(/src/i.test(e)){s.triggerSourceset(n.src)}return i};n.load=()=>{const e=t.call(n);if(!ba(s)){s.triggerSourceset("");wa(s)}return e};if(n.currentSrc){s.triggerSourceset(n.currentSrc)}else if(!ba(s)){wa(s)}n.resetSourceset_=()=>{n.resetSourceset_=null;n.load=t;n.setAttribute=r;Object.defineProperty(n,"src",i);if(n.resetSourceWatch_){n.resetSourceWatch_()}}};class S extends T{constructor(e,t){super(e,t);const i=e.source;let s=false;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO";if(i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)){this.setSource(i)}else{this.handleLateInit_(this.el_)}if(e.enableSourceset){this.setupSourcesetHandling_()}this.isScrubbing_=false;if(this.el_.hasChildNodes()){const n=this.el_.childNodes;let e=n.length;const r=[];while(e--){const a=n[e];const o=a.nodeName.toLowerCase();if(o==="track"){if(!this.featuresNativeTextTracks){r.push(a)}else{this.remoteTextTrackEls().addTrackElement_(a);this.remoteTextTracks().addTrack(a.track);this.textTracks().addTrack(a.track);if(!s&&!this.el_.hasAttribute("crossorigin")&&xi(a.src)){s=true}}}}for(let e=0;e<r.length;e++){this.el_.removeChild(r[e])}}this.proxyNativeTracks_();if(this.featuresNativeTextTracks&&s){d.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n"+"This may prevent text tracks from loading.")}this.restoreMetadataTracksInIOSNativePlayer_();if((Ee||ve)&&e.nativeControlsForTouch===true){this.setControls(true)}this.proxyWebkitFullscreen_();this.triggerReady()}dispose(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_()}S.disposeMediaElement(this.el_);this.options_=null;super.dispose()}setupSourcesetHandling_(){ka(this)}restoreMetadataTracksInIOSNativePlayer_(){const i=this.textTracks();let s;const e=()=>{s=[];for(let e=0;e<i.length;e++){const t=i[e];if(t.kind==="metadata"){s.push({track:t,storedMode:t.mode})}}};e();i.addEventListener("change",e);this.on("dispose",()=>i.removeEventListener("change",e));const n=()=>{for(let e=0;e<s.length;e++){const t=s[e];if(t.track.mode==="disabled"&&t.track.mode!==t.storedMode){t.track.mode=t.storedMode}}i.removeEventListener("change",n)};this.on("webkitbeginfullscreen",()=>{i.removeEventListener("change",e);i.removeEventListener("change",n);i.addEventListener("change",n)});this.on("webkitendfullscreen",()=>{i.removeEventListener("change",e);i.addEventListener("change",e);i.removeEventListener("change",n)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`]){return}const i=e.toLowerCase();if(this[`${i}TracksListeners_`]){Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{const t=this.el()[`${i}Tracks`];t.removeEventListener(e,this[`${i}TracksListeners_`][e])})}this[`featuresNative${e}Tracks`]=!t;this[`${i}TracksListeners_`]=null;this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(i){const e=fs[i];const s=this.el()[e.getterName];const n=this[e.getterName]();if(!this[`featuresNative${e.capitalName}Tracks`]||!s||!s.addEventListener){return}const r={change:e=>{const t={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(t);if(i==="text"){this[ps.remoteText.getterName]().trigger(t)}},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}};const t=function(){const e=[];for(let i=0;i<n.length;i++){let t=false;for(let e=0;e<s.length;e++){if(s[e]===n[i]){t=true;break}}if(!t){e.push(n[i])}}while(e.length){n.removeTrack(e.shift())}};this[e.getterName+"Listeners_"]=r;Object.keys(r).forEach(t=>{const i=r[t];s.addEventListener(t,i);this.on("dispose",e=>s.removeEventListener(t,i))});this.on("loadstart",t);this.on("dispose",e=>this.off("loadstart",t))}proxyNativeTracks_(){fs.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let t=this.options_.tag;if(!t||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(t){const e=t.cloneNode(true);if(t.parentNode){t.parentNode.insertBefore(e,t)}S.disposeMediaElement(t);t=e}else{t=Ny.createElement("video");const s=this.options_.tag&&qe(this.options_.tag);const n=h({},s);if(!Ee||this.options_.nativeControlsForTouch!==true){delete n.controls}Fe(t,Object.assign(n,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){Ve(t,"preload",this.options_.preload)}if(this.options_.disablePictureInPicture!==undefined){t.disablePictureInPicture=this.options_.disablePictureInPicture}const i=["loop","muted","playsinline","autoplay"];for(let e=0;e<i.length;e++){const r=i[e];const a=this.options_[r];if(typeof a!=="undefined"){if(a){Ve(t,r,r)}else{$e(t,r)}t[r]=a}}return t}handleLateInit_(e){if(e.networkState===0||e.networkState===3){return}if(e.readyState===0){let e=false;const i=function(){e=true};this.on("loadstart",i);const s=function(){if(!e){this.trigger("loadstart")}};this.on("loadedmetadata",s);this.ready(function(){this.off("loadstart",i);this.off("loadedmetadata",s);if(!e){this.trigger("loadstart")}});return}const t=["loadstart"];t.push("loadedmetadata");if(e.readyState>=2){t.push("loadeddata")}if(e.readyState>=3){t.push("canplay")}if(e.readyState>=4){t.push("canplaythrough")}this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{if(this.isScrubbing_&&this.el_.fastSeek&&Ie){this.el_.fastSeek(e)}else{this.el_.currentTime=e}}catch(e){d(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===Infinity&&ae&&de&&this.el_.currentTime===0){const e=()=>{if(this.el_.currentTime>0){if(this.el_.duration===Infinity){this.trigger("durationchange")}this.off("timeupdate",e)}};this.on("timeupdate",e);return NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_)){return}const e=function(){this.trigger("fullscreenchange",{isFullscreen:false});if(this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()){this.el_.controls=false}};const t=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",e);this.trigger("fullscreenchange",{isFullscreen:true,nativeIOSFullscreen:true})}};this.on("webkitbeginfullscreen",t);this.on("dispose",()=>{this.off("webkitbeginfullscreen",t);this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA){oi(this.el_.play());this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0)}else{try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){return this.el_.requestVideoFrameCallback(e)}return super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){this.el_.cancelVideoFrameCallback(e)}else{super.cancelVideoFrameCallback(e)}}src(e){if(e===undefined){return this.el_.src}this.setSrc(e)}reset(){S.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){if(!this.featuresNativeTextTracks){return super.addTextTrack(e,t,i)}return this.el_.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks){return super.createRemoteTextTrack(e)}const t=Ny.createElement("track");if(e.kind){t.kind=e.kind}if(e.label){t.label=e.label}if(e.language||e.srclang){t.srclang=e.language||e.srclang}if(e.default){t.default=e.default}if(e.id){t.id=e.id}if(e.src){t.src=e.src}return t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);if(this.featuresNativeTextTracks){this.el().appendChild(i)}return i}removeRemoteTextTrack(t){super.removeRemoteTextTrack(t);if(this.featuresNativeTextTracks){const i=this.$$("track");let e=i.length;while(e--){if(t===i[e]||t===i[e].track){this.el().removeChild(i[e])}}}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}const e={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){e.droppedVideoFrames=this.el().webkitDroppedFrameCount;e.totalVideoFrames=this.el().webkitDecodedFrameCount}if(Ly.performance){e.creationTime=Ly.performance.now()}return e}}ie(S,"TEST_VID",function(){if(!De()){return}const e=Ny.createElement("video");const t=Ny.createElement("track");t.kind="captions";t.srclang="en";t.label="English";e.appendChild(t);return e});S.isSupported=function(){try{S.TEST_VID.volume=.5}catch(e){return false}return!!(S.TEST_VID&&S.TEST_VID.canPlayType)};S.canPlayType=function(e){return S.TEST_VID.canPlayType(e)};S.canPlaySource=function(e,t){return S.canPlayType(e.type)};S.canControlVolume=function(){try{const e=S.TEST_VID.volume;S.TEST_VID.volume=e/2+.1;const t=e!==S.TEST_VID.volume;if(t&&f){Ly.setTimeout(()=>{if(S&&S.prototype){S.prototype.featuresVolumeControl=e!==S.TEST_VID.volume}});return false}return t}catch(e){return false}};S.canMuteVolume=function(){try{const e=S.TEST_VID.muted;S.TEST_VID.muted=!e;if(S.TEST_VID.muted){Ve(S.TEST_VID,"muted","muted")}else{$e(S.TEST_VID,"muted","muted")}return e!==S.TEST_VID.muted}catch(e){return false}};S.canControlPlaybackRate=function(){if(ae&&de&&fe<58){return false}try{const e=S.TEST_VID.playbackRate;S.TEST_VID.playbackRate=e/2+.1;return e!==S.TEST_VID.playbackRate}catch(e){return false}};S.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(Ny.createElement("video"),"src",{get:e,set:e});Object.defineProperty(Ny.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(Ny.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(Ny.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return false}return true};S.supportsNativeTextTracks=function(){return Ie||f&&de};S.supportsNativeVideoTracks=function(){return!!(S.TEST_VID&&S.TEST_VID.videoTracks)};S.supportsNativeAudioTracks=function(){return!!(S.TEST_VID&&S.TEST_VID.audioTracks)};S.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){ie(S.prototype,e,()=>S[t](),true)});S.prototype.featuresVolumeControl=S.canControlVolume();S.prototype.movingMediaElementInDOM=!f;S.prototype.featuresFullscreenResize=true;S.prototype.featuresProgressEvents=true;S.prototype.featuresTimeupdateEvents=true;S.prototype.featuresVideoFrameCallback=!!(S.TEST_VID&&S.TEST_VID.requestVideoFrameCallback);S.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};S.resetMediaElement=function(e){if(!e){return}const t=e.querySelectorAll("source");let i=t.length;while(i--){e.removeChild(t[i])}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){S.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){S.prototype["set"+c(t)]=function(e){this.el_[t]=e;if(e){this.el_.setAttribute(t,t)}else{this.el_.removeAttribute(t)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){S.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){S.prototype["set"+c(t)]=function(e){this.el_[t]=e}});["pause","load","play"].forEach(function(e){S.prototype[e]=function(){return this.el_[e]()}});T.withSourceHandlers(S);S.nativeSourceHandler={};S.nativeSourceHandler.canPlayType=function(e){try{return S.TEST_VID.canPlayType(e)}catch(e){return""}};S.nativeSourceHandler.canHandleSource=function(e,t){if(e.type){return S.nativeSourceHandler.canPlayType(e.type)}else if(e.src){const i=Di(e.src);return S.nativeSourceHandler.canPlayType(`video/${i}`)}return""};S.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)};S.nativeSourceHandler.dispose=function(){};S.registerSourceHandler(S.nativeSourceHandler);T.registerTech("Html5",S);const Aa=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];const Da={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};const xa=["tiny","xsmall","small","medium","large","xlarge","huge"];const Oa={};xa.forEach(e=>{const t=e.charAt(0)==="x"?`x-${e.substring(1)}`:e;Oa[e]=`vjs-layout-${t}`});const Pa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class E extends g{constructor(e,t,i){e.id=e.id||t.id||`vjs_video_${mt()}`;t=Object.assign(E.getTagSettings(e),t);t.initChildren=false;t.createEl=false;t.evented=false;t.reportTouchActivity=false;if(!t.language){const r=e.closest("[lang]");if(r){t.language=r.getAttribute("lang")}}super(null,t,i);this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e);this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e);this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e);this.boundApplyInitTime_=e=>this.applyInitTime_(e);this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e);this.boundHandleTechClick_=e=>this.handleTechClick_(e);this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e);this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e);this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e);this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e);this.boundHandleTechTap_=e=>this.handleTechTap_(e);this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e);this.isFullscreen_=false;this.log=Y(this.id_);this.fsApi_=V;this.isPosterFromTech_=false;this.queuedCallbacks_=[];this.isReady_=false;this.hasStarted_=false;this.userActive_=false;this.debugEnabled_=false;this.audioOnlyMode_=false;this.audioPosterMode_=false;this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]};if(!this.options_||!this.options_.techOrder||!this.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite "+"videojs.options instead of just changing the "+"properties you want to override?")}this.tag=e;this.tagAttributes=e&&qe(e);this.language(this.options_.language);if(t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(e){a[e.toLowerCase()]=t.languages[e]});this.languages_=a}else{this.languages_=E.prototype.options_.languages}this.resetCache_();this.poster_=t.poster||"";this.controls_=!!t.controls;e.controls=false;e.removeAttribute("controls");this.changingSrc_=false;this.playCallbacks_=[];this.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){this.autoplay(true)}else{this.autoplay(this.options_.autoplay)}if(t.plugins){Object.keys(t.plugins).forEach(e=>{if(typeof this[e]!=="function"){throw new Error(`plugin "${e}" does not exist`)}})}this.scrubbing_=false;this.el_=this.createEl();$t(this,{eventBusKey:"el_"});if(this.fsApi_.requestFullscreen){St(Ny,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fluid_){this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}const s=h(this.options_);if(t.plugins){Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])})}if(t.debug){this.debug(true)}this.options_.playerOptions=s;this.middleware_=[];this.playbackRates(t.playbackRates);if(t.experimentalSvgIcons){const o=new Ly.DOMParser;const l=o.parseFromString(Cn,"image/svg+xml");const c=l.querySelector("parsererror");if(c){d.warn("Failed to load SVG Icons. Falling back to Font Icons.");this.options_.experimentalSvgIcons=null}else{const u=l.documentElement;u.style.display="none";this.el_.appendChild(u);this.addClass("vjs-svg-icons-enabled")}}this.initChildren();this.isAudio(e.nodeName.toLowerCase()==="audio");if(this.controls()){this.addClass("vjs-controls-enabled")}else{this.addClass("vjs-controls-disabled")}this.el_.setAttribute("role","region");if(this.isAudio()){this.el_.setAttribute("aria-label",this.localize("Audio Player"))}else{this.el_.setAttribute("aria-label",this.localize("Video Player"))}if(this.isAudio()){this.addClass("vjs-audio")}if(t.spatialNavigation&&t.spatialNavigation.enabled){this.spatialNavigation=new xn(this);this.addClass("vjs-spatial-navigation-enabled")}if(Ee){this.addClass("vjs-touch-enabled")}if(!f){this.addClass("vjs-workinghover")}E.players[this.id_]=this;const n=U.split(".")[0];this.addClass(`vjs-v${n}`);this.userActive(true);this.reportUserActivity();this.one("play",e=>this.listenForUserActivity_(e));this.on("keydown",e=>this.handleKeyDown(e));this.on("languagechange",e=>this.handleLanguagechange(e));this.breakpoints(this.options_.breakpoints);this.responsive(this.options_.responsive);this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode);this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose");this.off("dispose");l(Ny,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);l(Ny,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}E.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}_n(this);_.names.forEach(e=>{const t=_[e];const i=this[t.getterName]();if(i&&i.off){i.off()}});super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let t=this.tag;let i;let e=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";if(e){i=this.el_=t.parentNode}else if(!s){i=this.el_=super.createEl("div")}const n=qe(t);if(s){i=this.el_=t;t=this.tag=Ny.createElement("video");while(i.children.length){t.appendChild(i.firstChild)}if(!Ne(i,"video-js")){Me(i,"video-js")}i.appendChild(t);e=this.playerElIngest_=i;Object.keys(i).forEach(e=>{try{t[e]=i[e]}catch(e){}})}t.setAttribute("tabindex","-1");n.tabindex="-1";if(de&&ye){t.setAttribute("role","application");n.role="application"}t.removeAttribute("width");t.removeAttribute("height");if("width"in n){delete n.width}if("height"in n){delete n.height}Object.getOwnPropertyNames(n).forEach(function(e){if(!(s&&e==="class")){i.setAttribute(e,n[e])}if(s){t.setAttribute(e,n[e])}});t.playerId=t.id;t.id+="_html5_api";t.className="vjs-tech";t.player=i.player=this;this.addClass("vjs-paused");const r=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>Ce[e]).map(e=>{return"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-")});this.addClass(...r);if(Ly.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=dt("vjs-styles-dimensions");const o=tt(".vjs-styles-defaults");const l=tt("head");l.insertBefore(this.styleEl_,o?o.nextSibling:l.firstChild)}this.fill_=false;this.fluid_=false;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){const c=a.item(e);Me(c,"vjs-hidden");c.setAttribute("hidden","hidden")}t.initNetworkState_=t.networkState;if(t.parentNode&&!e){t.parentNode.insertBefore(i,t)}Le(t,i);this.children_.unshift(t);this.el_.setAttribute("lang",this.language_);this.el_.setAttribute("translate","no");this.el_=i;return i}crossOrigin(e){if(typeof e==="undefined"){return this.techGet_("crossOrigin")}if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){d.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e);if(this.posterImage){this.posterImage.crossOrigin(e)}return}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===undefined){return this[i]||0}if(t===""||t==="auto"){this[i]=undefined;this.updateStyleEl_();return}const s=parseFloat(t);if(isNaN(s)){d.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=s;this.updateStyleEl_()}fluid(e){if(e===undefined){return!!this.fluid_}this.fluid_=!!e;if(Lt(this)){this.off(["playerreset","resize"],this.boundUpdateStyleEl_)}if(e){this.addClass("vjs-fluid");this.fill(false);Nt(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()}fill(e){if(e===undefined){return!!this.fill_}this.fill_=!!e;if(e){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}}aspectRatio(e){if(e===undefined){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(e)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=e;this.fluid(true);this.updateStyleEl_()}updateStyleEl_(){if(Ly.VIDEOJS_NO_DYNAMIC_STYLE===true){const e=typeof this.width_==="number"?this.width_:this.options_.width;const t=typeof this.height_==="number"?this.height_:this.options_.height;const a=this.tech_&&this.tech_.el();if(a){if(e>=0){a.width=e}if(t>=0){a.height=t}}return}let e;let t;let i;let s;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=="auto"){i=this.aspectRatio_}else if(this.videoWidth()>0){i=this.videoWidth()+":"+this.videoHeight()}else{i="16:9"}const n=i.split(":");const r=n[1]/n[0];if(this.width_!==undefined){e=this.width_}else if(this.height_!==undefined){e=this.height_/r}else{e=this.videoWidth()||300}if(this.height_!==undefined){t=this.height_}else{t=e*r}if(/^[^a-zA-Z]/.test(this.id())){s="dimensions-"+this.id()}else{s=this.id()+"-dimensions"}this.addClass(s);ht(this.styleEl_,` .${s} { width: ${e}px; height: ${t}px; } .${s}.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: ${r*100}%; } `)}loadTech_(e,t){if(this.tech_){this.unloadTech_()}const i=c(e);const s=e.charAt(0).toLowerCase()+e.slice(1);if(i!=="Html5"&&this.tag){T.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=i;this.isReady_=false;let n=this.autoplay();if(typeof this.autoplay()==="string"||this.autoplay()===true&&this.options_.normalizeAutoplay){n=false}const r={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||false,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};_.names.forEach(e=>{const t=_[e];r[t.getterName]=this[t.privateName]});Object.assign(r,this.options_[i]);Object.assign(r,this.options_[s]);Object.assign(r,this.options_[e.toLowerCase()]);if(this.tag){r.tag=this.tag}if(t&&t.src===this.cache_.src&&this.cache_.currentTime>0){r.startTime=this.cache_.currentTime}const a=T.getTech(e);if(!a){throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`)}this.tech_=new a(r);this.tech_.ready(m(this,this.handleTechReady_),true);di.jsonToTextTracks(this.textTracksJson_||[],this.tech_);Aa.forEach(t=>{this.on(this.tech_,t,e=>this[`handleTech${c(t)}_`](e))});Object.keys(Da).forEach(t=>{this.on(this.tech_,t,e=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Da[t]}_`].bind(this),event:e});return}this[`handleTech${Da[t]}_`](e)})});this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e));this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e));this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e));this.on(this.tech_,"ended",e=>this.handleTechEnded_(e));this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e));this.on(this.tech_,"play",e=>this.handleTechPlay_(e));this.on(this.tech_,"pause",e=>this.handleTechPause_(e));this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e));this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t));this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t));this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e));this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e));this.on(this.tech_,"error",e=>this.handleTechError_(e));this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e));this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e));this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e));this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)){Le(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}}unloadTech_(){_.names.forEach(e=>{const t=_[e];this[t.privateName]=this[t.getterName]()});this.textTracksJson_=di.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false}tech(e){if(e===undefined){d.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\n"+"See https://github.com/videojs/video.js/issues/2617 for more info.\n")}return this.tech_}version(){return{"video.js":U}}addTechControlsListeners_(){this.removeTechControlsListeners_();this.on(this.tech_,"click",this.boundHandleTechClick_);this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_);this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.off(this.tech_,"click",this.boundHandleTechClick_);this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady();if(this.cache_.volume){this.techCall_("setVolume",this.cache_.volume)}this.handleTechPosterChange_();this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking");this.error(null);this.handleTechDurationChange_();if(!this.paused()){this.trigger("loadstart")}else{this.hasStarted(false);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay()===true&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=="string"){return}const t=()=>{const e=this.muted();this.muted(true);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(!ai(i)){return}return i.catch(e=>{t();throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${e?e:""}`)})};let i;if(e==="any"&&!this.muted()){i=this.play();if(ai(i)){i=i.catch(t)}}else if(e==="muted"&&!this.muted()){i=t()}else{i=this.play()}if(!ai(i)){return}return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e;let i="";if(typeof t!=="string"){t=e.src;i=e.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(t&&!i){i=En(this,t)}this.cache_.source=h({},e,{src:t,type:i});const s=this.cache_.sources.filter(e=>e.src&&e.src===t);const n=[];const r=this.$$("source");const a=[];for(let e=0;e<r.length;e++){const o=qe(r[e]);n.push(o);if(o.src&&o.src===t){a.push(o.src)}}if(a.length&&!s.length){this.cache_.sources=n}else if(!s.length){this.cache_.sources=[this.cache_.source]}this.cache_.src=t}handleTechSourceset_(t){if(!this.changingSrc_){let e=e=>this.updateSourceCaches_(e);const i=this.currentSource().src;const s=t.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(s)){if(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i){e=()=>{}}}e(s);if(!t.src){this.tech_.any(["sourceset","loadstart"],e=>{if(e.type==="sourceset"){return}const t=this.techGet_("currentSrc");this.lastSource_.tech=t;this.updateSourceCaches_(t)})}}this.lastSource_={player:this.currentSource().src,tech:t.src};this.trigger({src:t.src,type:"sourceset"})}hasStarted(e){if(e===undefined){return this.hasStarted_}if(e===this.hasStarted_){return}this.hasStarted_=e;if(this.hasStarted_){this.addClass("vjs-has-started")}else{this.removeClass("vjs-has-started")}}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.hasStarted(true);this.trigger("play")}handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach(e=>e.callback(e.event));this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting");this.trigger("waiting");const e=this.currentTime();const t=()=>{if(e!==this.currentTime()){this.removeClass("vjs-waiting");this.off("timeupdate",t)}};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting");this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting");this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting");this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking");this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended");this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended");this.removeClass("vjs-waiting");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){if(!this.controls_){return}if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.click===undefined||this.options_.userActions.click!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.click==="function"){this.options_.userActions.click.call(this,e)}else if(this.paused()){oi(this.play())}else{this.pause()}}}handleTechDoubleClick_(t){if(!this.controls_){return}const e=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),e=>e.contains(t.target));if(!e){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==="function"){this.options_.userActions.doubleClick.call(this,t)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity()}}handleTechTouchEnd_(e){if(e.cancelable){e.preventDefault()}}toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this){return}const i=this.el();let s=Ny[this.fsApi_.fullscreenElement]===i;if(!s&&i.matches){s=i.matches(":"+this.fsApi_.fullscreen)}this.isFullscreen(s)}handleTechFullscreenChange_(e,t){if(t){if(t.nativeIOSFullscreen){this.addClass("vjs-ios-native-fs");this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})}this.isFullscreen(t.isFullscreen)}}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(true)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(false)}handleTechError_(){const e=this.tech_.error();if(e){this.error(e)}}handleTechTextData_(){let e=null;if(arguments.length>1){e=arguments[1]}this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in pn){return dn(this.middleware_,this.tech_,e,t)}else if(e in mn){return hn(this.middleware_,this.tech_,e,t)}try{if(this.tech_){this.tech_[e](t)}}catch(e){d(e);throw e}},true)}techGet_(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in fn){return un(this.middleware_,this.tech_,t)}else if(t in mn){return hn(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined){d(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`,e);throw e}if(e.name==="TypeError"){d(`Video.js: ${t} unavailable on ${this.techName_} playback technology element.`,e);this.tech_.isReady_=false;throw e}d(e);throw e}}play(){return new Promise(e=>{this.play_(e)})}play_(e=oi){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));const i=Boolean(Ie||f);if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!t&&i){this.load()}return}const s=this.techGet_("play");const n=i&&this.hasClass("vjs-ended");if(n){this.resetProgressBar_()}if(s===null){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(s)}}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];e.forEach(function(e){e()})}runPlayCallbacks_(t){const e=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];e.forEach(function(e){e(t)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")===false?false:true}played(){return this.techGet_("played")||Jt(0,0)}scrubbing(e){if(typeof e==="undefined"){return this.scrubbing_}this.scrubbing_=!!e;this.techCall_("setScrubbing",this.scrubbing_);if(e){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}}currentTime(e){if(e===undefined){this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime}if(e<0){e=0}if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e;this.off("canplay",this.boundApplyInitTime_);this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e);this.cache_.initTime=0;if(isFinite(e)){this.cache_.currentTime=Number(e)}}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}e=parseFloat(e);if(e<0){e=Infinity}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===Infinity){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(e)){this.trigger("durationchange")}}}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");if(!e||!e.length){e=Jt(0,0)}return e}seekable(){let e=this.techGet_("seekable");if(!e||!e.length){e=Jt(0,0)}return e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return ri(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered();const t=this.duration();let i=e.end(e.length-1);if(i>t){i=t}return i}volume(e){let t;if(e!==undefined){t=Math.max(0,Math.min(1,e));this.cache_.volume=t;this.techCall_("setVolume",t);if(t>0){this.lastVolume_(t)}return}t=parseFloat(this.techGet_("volume"));return isNaN(t)?1:t}muted(e){if(e!==undefined){this.techCall_("setMuted",e);return}return this.techGet_("muted")||false}defaultMuted(e){if(e!==undefined){this.techCall_("setDefaultMuted",e)}return this.techGet_("defaultMuted")||false}lastVolume_(e){if(e!==undefined&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||false}isFullscreen(e){if(e!==undefined){const t=this.isFullscreen_;this.isFullscreen_=Boolean(e);if(this.isFullscreen_!==t&&this.fsApi_.prefixed){this.trigger("fullscreenchange")}this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(a){if(this.isInPictureInPicture()){this.exitPictureInPicture()}const o=this;return new Promise((e,i)=>{function s(){o.off("fullscreenerror",n);o.off("fullscreenchange",t)}function t(){s();e()}function n(e,t){s();i(t)}o.one("fullscreenchange",t);o.one("fullscreenerror",n);const r=o.requestFullscreenHelper_(a);if(r){r.then(s,s);r.then(e,i)}})}requestFullscreenHelper_(e){let t;if(!this.fsApi_.prefixed){t=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(e!==undefined){t=e}}if(this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);if(i){i.then(()=>this.isFullscreen(true),()=>this.isFullscreen(false))}return i}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("enterFullScreen")}else{this.enterFullWindow()}}exitFullscreen(){const a=this;return new Promise((e,i)=>{function s(){a.off("fullscreenerror",n);a.off("fullscreenchange",t)}function t(){s();e()}function n(e,t){s();i(t)}a.one("fullscreenchange",t);a.one("fullscreenerror",n);const r=a.exitFullscreenHelper_();if(r){r.then(s,s);r.then(e,i)}})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=Ny[this.fsApi_.exitFullscreen]();if(e){oi(e.then(()=>this.isFullscreen(false)))}return e}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("exitFullScreen")}else{this.exitFullWindow()}}enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=Ny.documentElement.style.overflow;St(Ny,"keydown",this.boundFullWindowOnEscKey_);Ny.documentElement.style.overflow="hidden";Me(Ny.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(e){if(e.key==="Escape"){if(this.isFullscreen()===true){if(!this.isFullWindow){this.exitFullscreen()}else{this.exitFullWindow()}}}}exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;l(Ny,"keydown",this.boundFullWindowOnEscKey_);Ny.documentElement.style.overflow=this.docOrigOverflow;Ue(Ny.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===undefined){return this.techGet_("disablePictureInPicture")}this.techCall_("setDisablePictureInPicture",e);this.options_.disablePictureInPicture=e;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==undefined){this.isInPictureInPicture_=!!e;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&Ly.documentPictureInPicture){const i=Ny.createElement(this.el().tagName);i.classList=this.el().classList;i.classList.add("vjs-pip-container");if(this.posterImage){i.appendChild(this.posterImage.el().cloneNode(true))}if(this.titleBar){i.appendChild(this.titleBar.el().cloneNode(true))}i.appendChild(p("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture")));return Ly.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(e=>{nt(e);this.el_.parentNode.insertBefore(i,this.el_);e.document.body.appendChild(this.el_);e.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(true);this.player_.trigger({type:"enterpictureinpicture",pipWindow:e});e.addEventListener("pagehide",e=>{const t=e.target.querySelector(".video-js");i.parentNode.replaceChild(t,i);this.player_.isInPictureInPicture(false);this.player_.trigger("leavepictureinpicture")});return e})}if("pictureInPictureEnabled"in Ny&&this.disablePictureInPicture()===false){return this.techGet_("requestPictureInPicture")}return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(Ly.documentPictureInPicture&&Ly.documentPictureInPicture.window){Ly.documentPictureInPicture.window.close();return Promise.resolve()}if("pictureInPictureEnabled"in Ny){return Ny.exitPictureInPicture()}}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys){return}const i=e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable){return true}const i=["button","checkbox","hidden","radio","reset","submit"];if(t==="input"){return i.indexOf(e.type)===-1}const s=["textarea"];return s.indexOf(t)!==-1};if(i(this.el_.ownerDocument.activeElement)){return}if(typeof t.hotkeys==="function"){t.hotkeys.call(this,e)}else{this.handleHotkeys(e)}}handleHotkeys(t){const e=this.options_.userActions?this.options_.userActions.hotkeys:{};const{fullscreenKey:i=e=>t.key.toLowerCase()==="f",muteKey:s=e=>t.key.toLowerCase()==="m",playPauseKey:n=e=>t.key.toLowerCase()==="k"||t.key.toLowerCase()===" "}=e;if(i.call(this,t)){t.preventDefault();t.stopPropagation();const r=g.getComponent("FullscreenToggle");if(Ny[this.fsApi_.fullscreenEnabled]!==false){r.prototype.handleClick.call(this,t)}}else if(s.call(this,t)){t.preventDefault();t.stopPropagation();const e=g.getComponent("MuteToggle");e.prototype.handleClick.call(this,t)}else if(n.call(this,t)){t.preventDefault();t.stopPropagation();const e=g.getComponent("PlayToggle");e.prototype.handleClick.call(this,t)}}canPlayType(s){let n;for(let t=0,i=this.options_.techOrder;t<i.length;t++){const r=i[t];let e=T.getTech(r);if(!e){e=g.getComponent(r)}if(!e){d.error(`The "${r}" tech is undefined. Skipped browser support check for that tech.`);continue}if(e.isSupported()){n=e.canPlayType(s);if(n){return n}}}return""}selectSource(e){const t=this.options_.techOrder.map(e=>{return[e,T.getTech(e)]}).filter(([e,t])=>{if(t){return t.isSupported()}d.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`);return false});const i=function(e,i,s){let n;e.some(t=>{return i.some(e=>{n=s(t,e);if(n){return true}})});return n};let s;const n=i=>(e,t)=>i(t,e);const r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()])){return{source:i,tech:e}}};if(this.options_.sourceOrder){s=i(e,t,n(r))}else{s=i(t,e,r)}return s||false}handleSrc_(e,s){if(typeof e==="undefined"){return this.cache_.src||""}if(this.resetRetryOnError_){this.resetRetryOnError_()}const n=wn(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}this.changingSrc_=true;if(!s){this.cache_.sources=n}this.updateSourceCaches_(n[0]);ln(this,n[0],(e,t)=>{this.middleware_=t;if(!s){this.cache_.sources=n}this.updateSourceCaches_(e);const i=this.src_(e);if(i){if(n.length>1){return this.handleSrc_(n.slice(1))}this.changingSrc_=false;this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);this.triggerReady();return}cn(t,this.tech_)});if(n.length>1){const e=()=>{this.error(null);this.handleSrc_(n.slice(1),true)};const t=()=>{this.off("error",e)};this.one("error",e);this.one("playing",t);this.resetRetryOnError_=()=>{this.off("error",e);this.off("playing",t)}}}src(e){return this.handleSrc_(e,false)}src_(e){const t=this.selectSource([e]);if(!t){return true}if(!Wt(t.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(t.tech,t.source);this.tech_.ready(()=>{this.changingSrc_=false});return false}this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",e)}else{this.techCall_("src",e.src)}this.changingSrc_=false},true);return false}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused()){this.doReset_()}else{const e=this.play();oi(e.then(()=>this.doReset_()))}}doReset_(){if(this.tech_){this.tech_.clearTracks("text")}this.removeClass("vjs-playing");this.addClass("vjs-paused");this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();this.error(null);if(this.titleBar){this.titleBar.update({title:undefined,description:undefined})}if(Lt(this)){this.trigger("playerreset")}}resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{};const{seekBar:n}=i||{};if(e){e.updateContent()}if(t){t.updateContent()}if(s){s.updateContent()}if(n){n.update();if(n.loadProgressBar){n.loadProgressBar.update()}}}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1);this.trigger("volumechange")}currentSources(){const e=this.currentSource();const t=[];if(Object.keys(e).length!==0){t.push(e)}return this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==undefined){this.techCall_("setPreload",e);this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===undefined){return this.options_.autoplay||false}let t;if(typeof e==="string"&&/(any|play|muted)/.test(e)||e===true&&this.options_.normalizeAutoplay){this.options_.autoplay=e;this.manualAutoplay_(typeof e==="string"?e:"play");t=false}else if(!e){this.options_.autoplay=false}else{this.options_.autoplay=true}t=typeof t==="undefined"?this.options_.autoplay:t;if(this.tech_){this.techCall_("setAutoplay",t)}}playsinline(e){if(e!==undefined){this.techCall_("setPlaysinline",e);this.options_.playsinline=e}return this.techGet_("playsinline")}loop(e){if(e!==undefined){this.techCall_("setLoop",e);this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===undefined){return this.poster_}if(!e){e=""}if(e===this.poster_){return}this.poster_=e;this.techCall_("setPoster",e);this.isPosterFromTech_=false;this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";if(e!==this.poster_){this.poster_=e;this.isPosterFromTech_=true;this.trigger("posterchange")}}}controls(e){if(e===undefined){return!!this.controls_}e=!!e;if(this.controls_===e){return}this.controls_=e;if(this.usingNativeControls()){this.techCall_("setControls",e)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}}usingNativeControls(e){if(e===undefined){return!!this.usingNativeControls_}e=!!e;if(this.usingNativeControls_===e){return}this.usingNativeControls_=e;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}}error(i){if(i===undefined){return this.error_||null}F("beforeerror").forEach(e=>{const t=e(this,i);if(!(Z(t)&&!Array.isArray(t)||typeof t==="string"||typeof t==="number"||t===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}i=t});if(this.options_.suppressNotSupportedError&&i&&i.code===4){const e=function(){this.error(i)};this.options_.suppressNotSupportedError=false;this.any(["click","touchstart"],e);this.one("loadstart",function(){this.off(["click","touchstart"],e)});return}if(i===null){this.error_=null;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new t(i);this.addClass("vjs-error");d.error(`(CODE:${this.error_.code} ${t.errorTypes[this.error_.code]})`,this.error_.message,this.error_);this.trigger("error");F("error").forEach(e=>e(this,this.error_));return}reportUserActivity(e){this.userActivity_=true}userActive(e){if(e===undefined){return this.userActive_}e=!!e;if(e===this.userActive_){return}this.userActive_=e;if(this.userActive_){this.userActivity_=true;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",function(e){e.stopPropagation();e.preventDefault()})}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}listenForUserActivity_(){let t;let i;let s;const n=m(this,this.reportUserActivity);const e=function(e){if(e.screenX!==i||e.screenY!==s){i=e.screenX;s=e.screenY;n()}};const r=function(){n();this.clearInterval(t);t=this.setInterval(n,250)};const a=function(e){n();this.clearInterval(t)};this.on("mousedown",r);this.on("mousemove",e);this.on("mouseup",a);this.on("mouseleave",a);const o=this.getChild("controlBar");if(o&&!f&&!ae){o.on("mouseenter",function(e){if(this.player().options_.inactivityTimeout!==0){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout}this.player().options_.inactivityTimeout=0});o.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}this.on("keydown",n);this.on("keyup",n);let l;const c=function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(l);const e=this.options_.inactivityTimeout;if(e<=0){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(false)}},e)};this.setInterval(c,250)}playbackRate(e){if(e!==undefined){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1}defaultPlaybackRate(e){if(e!==undefined){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1}isAudio(e){if(e!==undefined){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");if(!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()){return}this.audioOnlyCache_.controlBarHeight=e.currentHeight();this.height(this.audioOnlyCache_.controlBarHeight)}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children();const t=this.getChild("ControlBar");const i=t&&t.currentHeight();e.forEach(e=>{if(e===t){return}if(e.el_&&!e.hasClass("vjs-hidden")){e.hide();this.audioOnlyCache_.hiddenChildren.push(e)}});this.audioOnlyCache_.playerHeight=this.currentHeight();this.audioOnlyCache_.controlBarHeight=i;this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_);this.height(i);this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode");this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_);this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show());this.height(this.audioOnlyCache_.playerHeight);this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!=="boolean"||e===this.audioOnlyMode_){return this.audioOnlyMode_}this.audioOnlyMode_=e;if(e){const t=[];if(this.isInPictureInPicture()){t.push(this.exitPictureInPicture())}if(this.isFullscreen()){t.push(this.exitFullscreen())}if(this.audioPosterMode()){t.push(this.audioPosterMode(false))}return Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){const e=this.tech_&&this.tech_;e.hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){const e=this.tech_&&this.tech_;e.show();this.removeClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}audioPosterMode(e){if(typeof e!=="boolean"||e===this.audioPosterMode_){return this.audioPosterMode_}this.audioPosterMode_=e;if(e){if(this.audioOnlyMode()){const t=this.audioOnlyMode(false);return t.then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_){return this.tech_.addTextTrack(e,t,i)}}addRemoteTextTrack(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}}removeRemoteTextTrack(e={}){let{track:t}=e;if(!t){t=e}if(this.tech_){return this.tech_.removeRemoteTextTrack(t)}}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===undefined){return this.language_}if(this.language_!==String(e).toLowerCase()){this.language_=String(e).toLowerCase();if(Lt(this)){this.trigger("languagechange")}}}languages(){return h(E.prototype.options_.languages,this.languages_)}toJSON(){const i=h(this.options_);const s=i.tracks;i.tracks=[];for(let t=0;t<s.length;t++){let e=s[t];e=h(e);e.player=undefined;i.tracks[t]=e}return i}createModal(e,t){t=t||{};t.content=e||"";const i=new fi(this,t);this.addChild(i);i.on("dispose",()=>{this.removeChild(i)});i.open();return i}updateCurrentBreakpoint_(){if(!this.responsive()){return}const t=this.currentBreakpoint();const i=this.currentWidth();for(let e=0;e<xa.length;e++){const s=xa[e];const n=this.breakpoints_[s];if(i<=n){if(t===s){return}if(t){this.removeClass(Oa[t])}this.addClass(Oa[s]);this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="";if(e){this.removeClass(e)}}breakpoints(e){if(e===undefined){return Object.assign(this.breakpoints_)}this.breakpoint_="";this.breakpoints_=Object.assign({},Pa,e);this.updateCurrentBreakpoint_();return Object.assign(this.breakpoints_)}responsive(e){if(e===undefined){return this.responsive_}e=Boolean(e);const t=this.responsive_;if(e===t){return}this.responsive_=e;if(e){this.on("playerresize",this.boundUpdateCurrentBreakpoint_);this.updateCurrentBreakpoint_()}else{this.off("playerresize",this.boundUpdateCurrentBreakpoint_);this.removeCurrentBreakpoint_()}return e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Oa[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!=="object"){return}const i=this.crossOrigin();this.reset();this.cache_.media=h(e);const{artist:s,artwork:n,description:r,poster:a,src:o,textTracks:l,title:c}=this.cache_.media;if(!n&&a){this.cache_.media.artwork=[{src:a,type:Sn(a)}]}if(i){this.crossOrigin(i)}if(o){this.src(o)}if(a){this.poster(a)}if(Array.isArray(l)){l.forEach(e=>this.addRemoteTextTrack(e,false))}if(this.titleBar){this.titleBar.update({title:c,description:r||s||""})}this.ready(t)}getMedia(){if(!this.cache_.media){const t=this.poster();const i=this.currentSources();const s=Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}));const e={src:i,textTracks:s};if(t){e.poster=t;e.artwork=[{src:e.poster,type:Sn(e.poster)}]}return e}return h(this.cache_.media)}static getTagSettings(e){const i={sources:[],tracks:[]};const t=qe(e);const s=t["data-setup"];if(Ne(e,"vjs-fill")){t.fill=true}if(Ne(e,"vjs-fluid")){t.fluid=true}if(s!==null){try{Object.assign(t,JSON.parse(s||"{}"))}catch(e){d.error("data-setup",e)}}Object.assign(i,t);if(e.hasChildNodes()){const n=e.childNodes;for(let e=0,t=n.length;e<t;e++){const r=n[e];const a=r.nodeName.toLowerCase();if(a==="source"){i.sources.push(qe(r))}else if(a==="track"){i.tracks.push(qe(r))}}}return i}debug(e){if(e===undefined){return this.debugEnabled_}if(e){this.trigger("debugon");this.previousLogLevel_=this.log.level;this.log.level("debug");this.debugEnabled_=true}else{this.trigger("debugoff");this.log.level(this.previousLogLevel_);this.previousLogLevel_=undefined;this.debugEnabled_=false}}playbackRates(e){if(e===undefined){return this.cache_.playbackRates}if(!Array.isArray(e)){return}if(!e.every(e=>typeof e==="number")){return}this.cache_.playbackRates=e;this.trigger("playbackrateschange")}}_.names.forEach(function(e){const t=_[e];E.prototype[t.getterName]=function(){if(this.tech_){return this.tech_[t.getterName]()}this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});E.prototype.crossorigin=E.prototype.crossOrigin;E.players={};const Ra=Ly.navigator;E.prototype.options_={techOrder:T.defaultTechOrder_,html5:{},enableSourceset:true,inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ra&&(Ra.languages&&Ra.languages[0]||Ra.userLanguage||Ra.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:false,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:false,audioOnlyMode:false,audioPosterMode:false,spatialNavigation:{enabled:false,horizontalSeek:false},enableSmoothSeeking:false};Aa.forEach(function(e){E.prototype[`handleTech${c(e)}_`]=function(){return this.trigger(e)}});g.registerComponent("Player",E);const La="plugin";const Na="activePlugins_";const Ma={};const Ua=e=>Ma.hasOwnProperty(e);const Ba=e=>Ua(e)?Ma[e]:undefined;const Fa=(e,t)=>{e[Na]=e[Na]||{};e[Na][t]=true};const qa=(e,t,i)=>{const s=(i?"before":"")+"pluginsetup";e.trigger(s,t);e.trigger(s+":"+t.name,t)};const ja=function(t,i){const s=function(){qa(this,{name:t,plugin:i,instance:null},true);const e=i.apply(this,arguments);Fa(this,t);qa(this,{name:t,plugin:i,instance:e});return e};Object.keys(i).forEach(function(e){s[e]=i[e]});return s};const Va=(i,s)=>{s.prototype.name=i;return function(...e){qa(this,{name:i,plugin:s,instance:null},true);const t=new s(...[this,...e]);this[i]=()=>t;qa(this,t.getEventHash());return t}};class $a{constructor(e){if(this.constructor===$a){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=e;if(!this.log){this.log=this.player.log.createLogger(this.name)}$t(this);delete this.trigger;Gt(this,this.constructor.defaultState);Fa(e,this.name);this.dispose=this.dispose.bind(this);e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){e.name=this.name;e.plugin=this.constructor;e.instance=this;return e}trigger(e,t={}){return Et(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose");this.off();t.off("dispose",this.dispose);t[Na][e]=false;this.player=this.state=null;t[e]=Va(e,Ma[e])}static isBasic(e){const t=typeof e==="string"?Ba(e):e;return typeof t==="function"&&!$a.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!=="string"){throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`)}if(Ua(e)){d.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`)}else if(E.prototype.hasOwnProperty(e)){throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`)}if(typeof t!=="function"){throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`)}Ma[e]=t;if(e!==La){if($a.isBasic(t)){E.prototype[e]=ja(e,t)}else{E.prototype[e]=Va(e,t)}}return t}static deregisterPlugin(e){if(e===La){throw new Error("Cannot de-register base plugin.")}if(Ua(e)){delete Ma[e];delete E.prototype[e]}}static getPlugins(e=Object.keys(Ma)){let i;e.forEach(e=>{const t=Ba(e);if(t){i=i||{};i[e]=t}});return i}static getPluginVersion(e){const t=Ba(e);return t&&t.VERSION||""}}$a.getPlugin=Ba;$a.BASE_PLUGIN_NAME=La;$a.registerPlugin(La,$a);E.prototype.usingPlugin=function(e){return!!this[Na]&&this[Na][e]===true};E.prototype.hasPlugin=function(e){return!!Ua(e)};function Ha(t,i){let s=false;return function(...e){if(!s){d.warn(t)}s=true;return i.apply(this,e)}}function Ga(e,t,i,s){return Ha(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s)}var za={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Wa=e=>e.indexOf("#")===0?e.slice(1):e;function C(e,i,t){let s=C.getPlayer(e);if(s){if(i){d.warn(`Player "${e}" is already initialised. Options will not be applied.`)}if(t){s.ready(t)}return s}const n=typeof e==="string"?tt("#"+Wa(e)):e;if(!xe(n)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}const r="getRootNode"in n?n.getRootNode()instanceof Ly.ShadowRoot:false;const a=r?n.getRootNode():n.ownerDocument.body;if(!n.ownerDocument.defaultView||!a.contains(n)){d.warn("The element supplied is not included in the DOM")}i=i||{};if(i.restoreEl===true){i.restoreEl=(n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(true)}F("beforesetup").forEach(e=>{const t=e(n,h(i));if(!Z(t)||Array.isArray(t)){d.error("please return an object in beforesetup hooks");return}i=h(i,t)});const o=g.getComponent("Player");s=new o(n,i,t);F("setup").forEach(e=>e(s));return s}C.hooks_=B;C.hooks=F;C.hook=i;C.hookOnce=j;C.removeHook=q;if(Ly.VIDEOJS_NO_DYNAMIC_STYLE!==true&&De()){let e=tt(".vjs-styles-defaults");if(!e){e=dt("vjs-styles-defaults");const Oy=tt("head");if(Oy){Oy.insertBefore(e,Oy.firstChild)}ht(e,` .video-js { width: 300px; height: 150px; } .vjs-fluid:not(.vjs-audio-only-mode) { padding-top: 56.25% } `)}}ct(1,C);C.VERSION=U;C.options=E.prototype.options_;C.getPlayers=()=>E.players;C.getPlayer=e=>{const t=E.players;let i;if(typeof e==="string"){const s=Wa(e);const n=t[s];if(n){return n}i=tt("#"+s)}else{i=e}if(xe(i)){const{player:n,playerId:e}=i;if(n||t[e]){return n||t[e]}}};C.getAllPlayers=()=>Object.keys(E.players).map(e=>E.players[e]).filter(Boolean);C.players=E.players;C.getComponent=g.getComponent;C.registerComponent=(e,t)=>{if(T.isTech(t)){d.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`)}return g.registerComponent.call(g,e,t)};C.getTech=T.getTech;C.registerTech=T.registerTech;C.use=on;Object.defineProperty(C,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(C.middleware,"TERMINATOR",{value:an,writeable:false,enumerable:true});C.browser=Ce;C.obj=se;C.mergeOptions=Ga(9,"videojs.mergeOptions","videojs.obj.merge",h);C.defineLazyProperty=Ga(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",ie);C.bind=Ga(9,"videojs.bind","native Function.prototype.bind",m);C.registerPlugin=$a.registerPlugin;C.deregisterPlugin=$a.deregisterPlugin;C.plugin=(e,t)=>{d.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return $a.registerPlugin(e,t)};C.getPlugins=$a.getPlugins;C.getPlugin=$a.getPlugin;C.getPluginVersion=$a.getPluginVersion;C.addLanguage=function(e,t){e=(""+e).toLowerCase();C.options.languages=h(C.options.languages,{[e]:t});return C.options.languages[e]};C.log=d;C.createLogger=Y;C.time=ni;C.createTimeRange=Ga(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Jt);C.createTimeRanges=Ga(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Jt);C.formatTime=Ga(9,"videojs.formatTime","videojs.time.formatTime",si);C.setFormatTime=Ga(9,"videojs.setFormatTime","videojs.time.setFormatTime",ti);C.resetFormatTime=Ga(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ii);C.parseUrl=Ga(9,"videojs.parseUrl","videojs.url.parseUrl",ki);C.isCrossOrigin=Ga(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",xi);C.EventTarget=Pt;C.any=It;C.on=St;C.one=wt;C.off=l;C.trigger=Et;C.xhr=Zi;C.TextTrack=cs;C.AudioTrack=us;C.VideoTrack=ds;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{C[e]=function(){d.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`);return rt[e].apply(null,arguments)}});C.computedStyle=Ga(9,"videojs.computedStyle","videojs.dom.computedStyle",st);C.dom=rt;C.fn=xt;C.num=Zn;C.str=Yt;C.url=Oi;C.Error=za;Li(function(i,e){(function(e,t){i.exports=t(C)})(Pi,function(e){function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);class s{constructor(e){let t=this;t.id=e.id;t.label=t.id;t.width=e.width;t.height=e.height;t.bitrate=e.bandwidth;t.frameRate=e.frameRate;t.enabled_=e.enabled;Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(e){t.enabled_(e)}});return t}}class r extends i["default"].EventTarget{constructor(){super();let e=this;e.levels_=[];e.selectedIndex_=-1;Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}});Object.defineProperty(e,"length",{get(){return e.levels_.length}});e[Symbol.iterator]=()=>e.levels_.values();return e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t){return t}const i=this.levels_.length;t=new s(e);if(!(""+i in this)){Object.defineProperty(this,i,{get(){return this.levels_[i]}})}this.levels_.push(t);this.trigger({qualityLevel:t,type:"addqualitylevel"});return t}removeQualityLevel(i){let s=null;for(let e=0,t=this.length;e<t;e++){if(this[e]===i){s=this.levels_.splice(e,1)[0];if(this.selectedIndex_===e){this.selectedIndex_=-1}else if(this.selectedIndex_>e){this.selectedIndex_--}break}}if(s){this.trigger({qualityLevel:i,type:"removequalitylevel"})}return s}getQualityLevelById(i){for(let e=0,t=this.length;e<t;e++){const s=this[e];if(s.id===i){return s}}return null}dispose(){this.selectedIndex_=-1;this.levels_.length=0}}r.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in r.prototype.allowedEvents_){r.prototype["on"+e]=null}var a="4.1.0";const n=function(e,t){const i=e.qualityLevels;const s=new r;const n=function(){s.dispose();e.qualityLevels=i;e.off("dispose",n)};e.on("dispose",n);e.qualityLevels=()=>s;e.qualityLevels.VERSION=a;return s};const o=function(e){return n(this,i["default"].obj.merge({},e))};i["default"].registerPlugin("qualityLevels",o);o.VERSION=a;return o})});var Ya=Li(function(n,e){(function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;var u=/^(?=([^\/?#]*))\1([^]*)$/;var t=/(?:\/|^)\.(?=\/)/g;var s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var d={buildAbsoluteURL:function(e,t,i){i=i||{};e=e.trim();t=t.trim();if(!t){if(!i.alwaysNormalize){return e}var s=d.parseURL(e);if(!s){throw new Error("Error trying to parse base URL.")}s.path=d.normalizePath(s.path);return d.buildURLFromParts(s)}var n=d.parseURL(t);if(!n){throw new Error("Error trying to parse relative URL.")}if(n.scheme){if(!i.alwaysNormalize){return t}n.path=d.normalizePath(n.path);return d.buildURLFromParts(n)}var r=d.parseURL(e);if(!r){throw new Error("Error trying to parse base URL.")}if(!r.netLoc&&r.path&&r.path[0]!=="/"){var a=u.exec(r.path);r.netLoc=a[1];r.path=a[2]}if(r.netLoc&&!r.path){r.path="/"}var o={scheme:r.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc){o.netLoc=r.netLoc;if(n.path[0]!=="/"){if(!n.path){o.path=r.path;if(!n.params){o.params=r.params;if(!n.query){o.query=r.query}}}else{var l=r.path;var c=l.substring(0,l.lastIndexOf("/")+1)+n.path;o.path=d.normalizePath(c)}}}if(o.path===null){o.path=i.alwaysNormalize?d.normalizePath(n.path):n.path}return d.buildURLFromParts(o)},parseURL:function(e){var t=i.exec(e);if(!t){return null}return{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(t,"");while(e.length!==(e=e.replace(s,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};n.exports=d})()});var Xa="http://example.com";var Ka=function e(t,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(t)){t=Ly.location&&Ly.location.href||""}var s=typeof Ly.URL==="function";var n=/^\/\//.test(t);var r=!Ly.location&&!/\/\//i.test(t);if(s){t=new Ly.URL(t,Ly.location||Xa)}else if(!/\/\//i.test(t)){t=Ya.buildAbsoluteURL(Ly.location&&Ly.location.href||"",t)}if(s){var a=new URL(i,t);if(r){return a.href.slice(Xa.length)}else if(n){return a.href.slice(a.protocol.length)}return a.href}return Ya.buildAbsoluteURL(t,i)};var Qa=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var a=i.length;for(var o=0;o<a;++o){i[o].apply(this,r)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var Ja=function e(t){return Ly.atob?Ly.atob(t):Py.from(t,"base64").toString("binary")};function Za(e){var t=Ja(e);var i=new Uint8Array(t.length);for(var s=0;s<t.length;s++){i[s]=t.charCodeAt(s)}return i}class eo extends Qa{constructor(){super();this.buffer=""}push(e){let t;this.buffer+=e;t=this.buffer.indexOf("\n");for(;t>-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const to=String.fromCharCode(9);const io=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const so=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const no=function(e){const t={};if(!e){return t}const i=e.split(so());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).slice(1);n[0]=n[0].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1");t[n[0]]=n[1]}return t};class ro extends Qa{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(s){let o;let l;s=s.trim();if(s.length===0){return}if(s[0]!=="#"){this.trigger("data",{type:"uri",uri:s});return}const e=this.tagMappers.reduce((e,t)=>{const i=t(s);if(i===s){return e}return e.concat([i])},[s]);e.forEach(t=>{for(let e=0;e<this.customParsers.length;e++){if(this.customParsers[e].call(this,t)){return}}if(t.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:t.slice(1)});return}t=t.replace("\r","");o=/^#EXTM3U/.exec(t);if(o){this.trigger("data",{type:"tag",tagType:"m3u"});return}o=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t);if(o){l={type:"tag",tagType:"inf"};if(o[1]){l.duration=parseFloat(o[1])}if(o[2]){l.title=o[2]}this.trigger("data",l);return}o=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t);if(o){l={type:"tag",tagType:"targetduration"};if(o[1]){l.duration=parseInt(o[1],10)}this.trigger("data",l);return}o=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t);if(o){l={type:"tag",tagType:"version"};if(o[1]){l.version=parseInt(o[1],10)}this.trigger("data",l);return}o=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(o){l={type:"tag",tagType:"media-sequence"};if(o[1]){l.number=parseInt(o[1],10)}this.trigger("data",l);return}o=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(o){l={type:"tag",tagType:"discontinuity-sequence"};if(o[1]){l.number=parseInt(o[1],10)}this.trigger("data",l);return}o=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t);if(o){l={type:"tag",tagType:"playlist-type"};if(o[1]){l.playlistType=o[1]}this.trigger("data",l);return}o=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t);if(o){l=y(io(o[1]),{type:"tag",tagType:"byterange"});this.trigger("data",l);return}o=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t);if(o){l={type:"tag",tagType:"allow-cache"};if(o[1]){l.allowed=!/NO/.test(o[1])}this.trigger("data",l);return}o=/^#EXT-X-MAP:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"map"};if(o[1]){const e=no(o[1]);if(e.URI){l.uri=e.URI}if(e.BYTERANGE){l.byterange=io(e.BYTERANGE)}}this.trigger("data",l);return}o=/^#EXT-X-STREAM-INF:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"stream-inf"};if(o[1]){l.attributes=no(o[1]);if(l.attributes.RESOLUTION){const e=l.attributes.RESOLUTION.split("x");const i={};if(e[0]){i.width=parseInt(e[0],10)}if(e[1]){i.height=parseInt(e[1],10)}l.attributes.RESOLUTION=i}if(l.attributes.BANDWIDTH){l.attributes.BANDWIDTH=parseInt(l.attributes.BANDWIDTH,10)}if(l.attributes["FRAME-RATE"]){l.attributes["FRAME-RATE"]=parseFloat(l.attributes["FRAME-RATE"])}if(l.attributes["PROGRAM-ID"]){l.attributes["PROGRAM-ID"]=parseInt(l.attributes["PROGRAM-ID"],10)}}this.trigger("data",l);return}o=/^#EXT-X-MEDIA:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"media"};if(o[1]){l.attributes=no(o[1])}this.trigger("data",l);return}o=/^#EXT-X-ENDLIST/.exec(t);if(o){this.trigger("data",{type:"tag",tagType:"endlist"});return}o=/^#EXT-X-DISCONTINUITY/.exec(t);if(o){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}o=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"program-date-time"};if(o[1]){l.dateTimeString=o[1];l.dateTimeObject=new Date(o[1])}this.trigger("data",l);return}o=/^#EXT-X-KEY:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"key"};if(o[1]){l.attributes=no(o[1]);if(l.attributes.IV){if(l.attributes.IV.substring(0,2).toLowerCase()==="0x"){l.attributes.IV=l.attributes.IV.substring(2)}l.attributes.IV=l.attributes.IV.match(/.{8}/g);l.attributes.IV[0]=parseInt(l.attributes.IV[0],16);l.attributes.IV[1]=parseInt(l.attributes.IV[1],16);l.attributes.IV[2]=parseInt(l.attributes.IV[2],16);l.attributes.IV[3]=parseInt(l.attributes.IV[3],16);l.attributes.IV=new Uint32Array(l.attributes.IV)}}this.trigger("data",l);return}o=/^#EXT-X-START:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"start"};if(o[1]){l.attributes=no(o[1]);l.attributes["TIME-OFFSET"]=parseFloat(l.attributes["TIME-OFFSET"]);l.attributes.PRECISE=/YES/.test(l.attributes.PRECISE)}this.trigger("data",l);return}o=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t);if(o){l={type:"tag",tagType:"cue-out-cont"};if(o[1]){l.data=o[1]}else{l.data=""}this.trigger("data",l);return}o=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t);if(o){l={type:"tag",tagType:"cue-out"};if(o[1]){l.data=o[1]}else{l.data=""}this.trigger("data",l);return}o=/^#EXT-X-CUE-IN:(.*)?$/.exec(t);if(o){l={type:"tag",tagType:"cue-in"};if(o[1]){l.data=o[1]}else{l.data=""}this.trigger("data",l);return}o=/^#EXT-X-SKIP:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"skip"};l.attributes=no(o[1]);if(l.attributes.hasOwnProperty("SKIPPED-SEGMENTS")){l.attributes["SKIPPED-SEGMENTS"]=parseInt(l.attributes["SKIPPED-SEGMENTS"],10)}if(l.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")){l.attributes["RECENTLY-REMOVED-DATERANGES"]=l.attributes["RECENTLY-REMOVED-DATERANGES"].split(to)}this.trigger("data",l);return}o=/^#EXT-X-PART:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"part"};l.attributes=no(o[1]);["DURATION"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=parseFloat(l.attributes[e])}});["INDEPENDENT","GAP"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=/YES/.test(l.attributes[e])}});if(l.attributes.hasOwnProperty("BYTERANGE")){l.attributes.byterange=io(l.attributes.BYTERANGE)}this.trigger("data",l);return}o=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"server-control"};l.attributes=no(o[1]);["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=parseFloat(l.attributes[e])}});["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=/YES/.test(l.attributes[e])}});this.trigger("data",l);return}o=/^#EXT-X-PART-INF:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"part-inf"};l.attributes=no(o[1]);["PART-TARGET"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=parseFloat(l.attributes[e])}});this.trigger("data",l);return}o=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"preload-hint"};l.attributes=no(o[1]);["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=parseInt(l.attributes[e],10);const t=e==="BYTERANGE-LENGTH"?"length":"offset";l.attributes.byterange=l.attributes.byterange||{};l.attributes.byterange[t]=l.attributes[e];delete l.attributes[e]}});this.trigger("data",l);return}o=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"rendition-report"};l.attributes=no(o[1]);["LAST-MSN","LAST-PART"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=parseInt(l.attributes[e],10)}});this.trigger("data",l);return}o=/^#EXT-X-DATERANGE:(.*)$/.exec(t);if(o&&o[1]){l={type:"tag",tagType:"daterange"};l.attributes=no(o[1]);["ID","CLASS"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=String(l.attributes[e])}});["START-DATE","END-DATE"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=new Date(l.attributes[e])}});["DURATION","PLANNED-DURATION"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=parseFloat(l.attributes[e])}});["END-ON-NEXT"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=/YES/i.test(l.attributes[e])}});["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){if(l.attributes.hasOwnProperty(e)){l.attributes[e]=l.attributes[e].toString(16)}});const s=/^X-([A-Z]+-)+[A-Z]+$/;for(const n in l.attributes){if(!s.test(n)){continue}const r=/[0-9A-Fa-f]{6}/g.test(l.attributes[n]);const a=/^\d+(\.\d+)?$/.test(l.attributes[n]);l.attributes[n]=r?l.attributes[n].toString(16):a?parseFloat(l.attributes[n]):String(l.attributes[n])}this.trigger("data",l);return}o=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(t);if(o){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}o=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(t);if(o){l={type:"tag",tagType:"content-steering"};l.attributes=no(o[1]);this.trigger("data",l);return}this.trigger("data",{type:"tag",data:t.slice(4)})})}addParser({expression:i,customType:s,dataParser:n,segment:r}){if(typeof n!=="function"){n=e=>e}this.customParsers.push(e=>{const t=i.exec(e);if(t){this.trigger("data",{type:"custom",data:n(e),customType:s,segment:r});return true}})}addTagMapper({expression:t,map:i}){const e=e=>{if(t.test(e)){return i(e)}return e};this.tagMappers.push(e)}}const ao=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const oo=function(t){const i={};Object.keys(t).forEach(function(e){i[ao(e)]=t[e]});return i};const lo=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=s&&s*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]<o){this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`});t[r]=o}if(s&&!t.hasOwnProperty(a)){t[a]=s*3;this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})}if(s&&t[a]<l){this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`});t[a]=l}};class co extends Qa{constructor(){super();this.lineStream=new eo;this.parseStream=new ro;this.lineStream.pipe(this.parseStream);this.lastProgramDateTime=null;const e=this;const s=[];let r={};let n;let a;let l=false;const c=function(){};const u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};const d="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:true,discontinuityStarts:[],dateRanges:[],segments:[]};let f=0;let p=0;const m={};this.on("end",()=>{if(r.uri||!r.parts&&!r.preloadHints){return}if(!r.map&&n){r.map=n}if(!r.key&&a){r.key=a}if(!r.timeline&&typeof h==="number"){r.timeline=h}this.manifest.preloadSegment=r});this.parseStream.on("data",function(o){let t;let i;({tag(){({version(){if(o.version){this.manifest.version=o.version}},"allow-cache"(){this.manifest.allowCache=o.allowed;if(!("allowed"in o)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in o){r.byterange=e;e.length=o.length;if(!("offset"in o)){o.offset=f}}if("offset"in o){r.byterange=e;e.offset=o.offset}f=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(o.title){r.title=o.title}if(o.duration>0){r.duration=o.duration}if(o.duration===0){r.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=s},key(){if(!o.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(o.attributes.METHOD==="NONE"){a=null;return}if(!o.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(o.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:o.attributes};return}if(o.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:o.attributes.URI};return}if(o.attributes.KEYFORMAT===d){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(o.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(o.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(o.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(o.attributes.KEYID&&o.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:o.attributes.KEYFORMAT,keyId:o.attributes.KEYID.substring(2)},pssh:Za(o.attributes.URI.split(",")[1])};return}if(!o.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}a={method:o.attributes.METHOD||"AES-128",uri:o.attributes.URI};if(typeof o.attributes.IV!=="undefined"){a.iv=o.attributes.IV}},"media-sequence"(){if(!isFinite(o.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+o.number});return}this.manifest.mediaSequence=o.number},"discontinuity-sequence"(){if(!isFinite(o.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+o.number});return}this.manifest.discontinuitySequence=o.number;h=o.number},"playlist-type"(){if(!/VOD|EVENT/.test(o.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+o.playlist});return}this.manifest.playlistType=o.playlistType},map(){n={};if(o.uri){n.uri=o.uri}if(o.byterange){n.byterange=o.byterange}if(a){n.key=a}},"stream-inf"(){this.manifest.playlists=s;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!o.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!r.attributes){r.attributes={}}y(r.attributes,o.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(o.attributes&&o.attributes.TYPE&&o.attributes["GROUP-ID"]&&o.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[o.attributes.TYPE];e[o.attributes["GROUP-ID"]]=e[o.attributes["GROUP-ID"]]||{};t=e[o.attributes["GROUP-ID"]];i={default:/yes/i.test(o.attributes.DEFAULT)};if(i.default){i.autoselect=true}else{i.autoselect=/yes/i.test(o.attributes.AUTOSELECT)}if(o.attributes.LANGUAGE){i.language=o.attributes.LANGUAGE}if(o.attributes.URI){i.uri=o.attributes.URI}if(o.attributes["INSTREAM-ID"]){i.instreamId=o.attributes["INSTREAM-ID"]}if(o.attributes.CHARACTERISTICS){i.characteristics=o.attributes.CHARACTERISTICS}if(o.attributes.FORCED){i.forced=/yes/i.test(o.attributes.FORCED)}t[o.attributes.NAME]=i},discontinuity(){h+=1;r.discontinuity=true;this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=o.dateTimeString;this.manifest.dateTimeObject=o.dateTimeObject}r.dateTimeString=o.dateTimeString;r.dateTimeObject=o.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(o.dateTimeString).getTime();if(e===null){this.manifest.segments.reduceRight((e,t)=>{t.programDateTime=e-t.duration*1e3;return t.programDateTime},this.lastProgramDateTime)}},targetduration(){if(!isFinite(o.duration)||o.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+o.duration});return}this.manifest.targetDuration=o.duration;lo.call(this,this.manifest)},start(){if(!o.attributes||isNaN(o.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:o.attributes["TIME-OFFSET"],precise:o.attributes.PRECISE}},"cue-out"(){r.cueOut=o.data},"cue-out-cont"(){r.cueOutCont=o.data},"cue-in"(){r.cueIn=o.data},skip(){this.manifest.skip=oo(o.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",o.attributes,["SKIPPED-SEGMENTS"])},part(){l=true;const e=this.manifest.segments.length;const t=oo(o.attributes);r.parts=r.parts||[];r.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=p}p=t.byterange.offset+t.byterange.length}const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,o.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=oo(o.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}lo.call(this,this.manifest);if(e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")){this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})}},"preload-hint"(){const t=this.manifest.segments.length;const i=oo(o.attributes);const e=i.type&&i.type==="PART";r.preloadHints=r.preloadHints||[];r.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=e?p:0;if(e){p=i.byterange.offset+i.byterange.length}}}const s=r.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,o.attributes,["TYPE","URI"]);if(!i.type){return}for(let e=0;e<r.preloadHints.length-1;e++){const n=r.preloadHints[e];if(!n.type){continue}if(n.type===i.type){this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`})}}},"rendition-report"(){const e=oo(o.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1;const i=["LAST-MSN","URI"];if(l){i.push("LAST-PART")}this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,o.attributes,i)},"part-inf"(){this.manifest.partInf=oo(o.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",o.attributes,["PART-TARGET"]);if(this.manifest.partInf.partTarget){this.manifest.partTargetDuration=this.manifest.partInf.partTarget}lo.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(oo(o.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,o.attributes,["ID","START-DATE"]);const t=this.manifest.dateRanges[e];if(t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)){this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"})}if(t.duration&&t.duration<0){this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"})}if(t.plannedDuration&&t.plannedDuration<0){this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"})}const i=!!t.endOnNext;if(i&&!t.class){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"})}if(i&&(t.duration||t.endDate)){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"})}if(t.duration&&t.endDate){const s=t.startDate;const n=s.getTime()+t.duration*1e3;this.manifest.dateRanges[e].endDate=new Date(n)}if(!m[t.id]){m[t.id]=t}else{for(const a in m[t.id]){if(!!t[a]&&JSON.stringify(m[t.id][a])!==JSON.stringify(t[a])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}}const r=this.manifest.dateRanges.findIndex(e=>e.id===t.id);this.manifest.dateRanges[r]=y(this.manifest.dateRanges[r],t);m[t.id]=y(m[t.id],t);this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=true},"content-steering"(){this.manifest.contentSteering=oo(o.attributes);this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",o.attributes,["SERVER-URI"])}}[o.tagType]||c).call(e)},uri(){r.uri=o.uri;s.push(r);if(this.manifest.targetDuration&&!("duration"in r)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});r.duration=this.manifest.targetDuration}if(a){r.key=a}r.timeline=h;if(n){r.map=n}p=0;if(this.lastProgramDateTime!==null){r.programDateTime=this.lastProgramDateTime;this.lastProgramDateTime+=r.duration*1e3}r={}},comment(){},custom(){if(o.segment){r.custom=r.custom||{};r.custom[o.customType]=o.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[o.customType]=o.data}}})[o.type].call(e)})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(e){if(!t.hasOwnProperty(e)){s.push(e)}});if(s.length){this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n");if(this.manifest.dateRanges.length&&this.lastProgramDateTime===null){this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"})}this.lastProgramDateTime=null;this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var uo={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/};var ho=["video","audio","text"];var fo=["Video","Audio","Text"];var po=function e(t){if(!t){return t}return t.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){var s=("00"+Number(t).toString(16)).slice(-2);var n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+s+"00"+n})};var mo=function e(t){if(t===void 0){t=""}var i=t.split(",");var a=[];i.forEach(function(n){n=n.trim();var r;ho.forEach(function(e){var t=uo[e].exec(n.toLowerCase());if(!t||t.length<=1){return}r=e;var i=n.substring(0,t[1].length);var s=n.replace(i,"");a.push({type:i,details:s,mediaType:e})});if(!r){a.push({type:n,details:"",mediaType:"unknown"})}});return a};var go=function e(t,i){if(!t.mediaGroups.AUDIO||!i){return null}var s=t.mediaGroups.AUDIO[i];if(!s){return null}for(var n in s){var r=s[n];if(r.default&&r.playlists){return mo(r.playlists[0].attributes.CODECS)}}return null};var yo=function e(t){if(t===void 0){t=""}return uo.audio.test(t.trim().toLowerCase())};var _o=function e(t){if(t===void 0){t=""}return uo.text.test(t.trim().toLowerCase())};var vo=function e(t){if(!t||typeof t!=="string"){return}var i=t.toLowerCase().split(",").map(function(e){return po(e.trim())});var s="video";if(i.length===1&&yo(i[0])){s="audio"}else if(i.length===1&&_o(i[0])){s="application"}var n="mp4";if(i.every(function(e){return uo.mp4.test(e)})){n="mp4"}else if(i.every(function(e){return uo.webm.test(e)})){n="webm"}else if(i.every(function(e){return uo.ogg.test(e)})){n="ogg"}return s+"/"+n+';codecs="'+t+'"'};var bo=function e(t){if(t===void 0){t=""}return Ly.MediaSource&&Ly.MediaSource.isTypeSupported&&Ly.MediaSource.isTypeSupported(vo(t))||false};var To=function e(t){if(t===void 0){t=""}return t.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<fo.length;t++){var i=fo[t];if(uo["muxer"+i].test(e)){return true}}return false})};var So="mp4a.40.2";var Eo="avc1.4d400d";var wo=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;var Io=/^application\/dash\+xml/i;var Co=function e(t){if(wo.test(t)){return"hls"}if(Io.test(t)){return"dash"}if(t==="application/vnd.videojs.vhs+json"){return"vhs-json"}return null};var ko=function e(t){return t.toString(2).length};var Ao=function e(t){return Math.ceil(ko(t)/8)};var Do=function e(t){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}return t&&t.buffer instanceof ArrayBuffer};var xo=function e(t){return Do(t)};var w=function e(t){if(t instanceof Uint8Array){return t}if(!Array.isArray(t)&&!xo(t)&&!(t instanceof ArrayBuffer)){if(typeof t!=="number"||typeof t==="number"&&t!==t){t=0}else{t=[t]}}return new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0)};var I=Ly.BigInt||Number;var Oo=[I("0x1"),I("0x100"),I("0x10000"),I("0x1000000"),I("0x100000000"),I("0x10000000000"),I("0x1000000000000"),I("0x100000000000000"),I("0x10000000000000000")];(function(){var e=new Uint16Array([65484]);var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t[0]===255){return"big"}if(t[0]===204){return"little"}return"unknown"})();var Po=function e(n,t){var i=t===void 0?{}:t,s=i.signed,r=s===void 0?false:s,a=i.le,o=a===void 0?false:a;n=w(n);var l=o?"reduce":"reduceRight";var c=n[l]?n[l]:Array.prototype[l];var u=c.call(n,function(e,t,i){var s=o?i:Math.abs(i+1-n.length);return e+I(t)*Oo[s]},I(0));if(r){var d=Oo[n.length]/I(2)-I(1);u=I(u);if(u>d){u-=d;u-=d;u-=I(2)}}return Number(u)};var Ro=function e(t,i){var s=i===void 0?{}:i,n=s.le,r=n===void 0?false:n;if(typeof t!=="bigint"&&typeof t!=="number"||typeof t==="number"&&t!==t){t=0}t=I(t);var a=Ao(t);var o=new Uint8Array(new ArrayBuffer(a));for(var l=0;l<a;l++){var c=r?l:Math.abs(l+1-o.length);o[c]=Number(t/Oo[l]&I(255));if(t<0){o[c]=Math.abs(~o[c]);o[c]-=l===0?1:2}}return o};var Lo=function e(t,i){if(typeof t!=="string"&&t&&typeof t.toString==="function"){t=t.toString()}if(typeof t!=="string"){return new Uint8Array}if(!i){t=unescape(encodeURIComponent(t))}var s=new Uint8Array(t.length);for(var n=0;n<t.length;n++){s[n]=t.charCodeAt(n)}return s};var No=function e(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++){i[s]=arguments[s]}i=i.filter(function(e){return e&&(e.byteLength||e.length)&&typeof e!=="string"});if(i.length<=1){return w(i[0])}var n=i.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0);var r=new Uint8Array(n);var a=0;i.forEach(function(e){e=w(e);r.set(e,a);a+=e.byteLength});return r};var k=function e(s,t,i){var n=i===void 0?{}:i,r=n.offset,a=r===void 0?0:r,o=n.mask,l=o===void 0?[]:o;s=w(s);t=w(t);var c=t.every?t.every:Array.prototype.every;return t.length&&s.length-a>=t.length&&c.call(t,function(e,t){var i=l[t]?l[t]&s[a+t]:s[a+t];return e===i})};var Mo=function e(n,t,r){t.forEach(function(e){for(var t in n.mediaGroups[e]){for(var i in n.mediaGroups[e][t]){var s=n.mediaGroups[e][t][i];r(s,e,t,i)}}})};var Uo=function e(t){return Ly.atob?Ly.atob(t):Py.from(t,"base64").toString("binary")};function Bo(e){var t=Uo(e);var i=new Uint8Array(t.length);for(var s=0;s<t.length;s++){i[s]=t.charCodeAt(s)}return i}function Fo(e,t,i){if(i===undefined){i=Array.prototype}if(e&&typeof i.find==="function"){return i.find.call(e,t)}for(var s=0;s<e.length;s++){if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];if(t.call(undefined,n,s,e)){return n}}}}function qo(e,t){if(t===undefined){t=Object}return t&&typeof t.freeze==="function"?t.freeze(e):e}function jo(e,t){if(e===null||typeof e!=="object"){throw new TypeError("target is not an object")}for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){e[i]=t[i]}}return e}var Vo=qo({HTML:"text/html",isHTML:function(e){return e===Vo.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"});var $o=qo({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===$o.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});var Ho=jo;var Go=Fo;var zo=qo;var Wo=Vo;var Yo=$o;var Xo={assign:Ho,find:Go,freeze:zo,MIME_TYPE:Wo,NAMESPACE:Yo};var Ko=Xo.find;var Qo=Xo.NAMESPACE;function Jo(e){return e!==""}function Zo(e){return e?e.split(/[\t\n\f\r ]+/).filter(Jo):[]}function el(e,t){if(!e.hasOwnProperty(t)){e[t]=true}return e}function tl(e){if(!e)return[];var t=Zo(e);return Object.keys(t.reduce(el,{}))}function il(t){return function(e){return t&&t.indexOf(e)!==-1}}function sl(e,t){for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t[i]=e[i]}}}function nl(e,t){var i=e.prototype;if(!(i instanceof t)){function s(){}s.prototype=t.prototype;s=new s;sl(i,s);e.prototype=i=s}if(i.constructor!=e){if(typeof e!="function"){console.error("unknown Class:"+e)}i.constructor=e}}var rl={};var al=rl.ELEMENT_NODE=1;var ol=rl.ATTRIBUTE_NODE=2;var ll=rl.TEXT_NODE=3;var cl=rl.CDATA_SECTION_NODE=4;var ul=rl.ENTITY_REFERENCE_NODE=5;var dl=rl.ENTITY_NODE=6;var hl=rl.PROCESSING_INSTRUCTION_NODE=7;var fl=rl.COMMENT_NODE=8;var pl=rl.DOCUMENT_NODE=9;var ml=rl.DOCUMENT_TYPE_NODE=10;var gl=rl.DOCUMENT_FRAGMENT_NODE=11;var yl=rl.NOTATION_NODE=12;var e={};var s={};e.INDEX_SIZE_ERR=(s[1]="Index size error",1);e.DOMSTRING_SIZE_ERR=(s[2]="DOMString size error",2);var _l=e.HIERARCHY_REQUEST_ERR=(s[3]="Hierarchy request error",3);e.WRONG_DOCUMENT_ERR=(s[4]="Wrong document",4);e.INVALID_CHARACTER_ERR=(s[5]="Invalid character",5);e.NO_DATA_ALLOWED_ERR=(s[6]="No data allowed",6);e.NO_MODIFICATION_ALLOWED_ERR=(s[7]="No modification allowed",7);var vl=e.NOT_FOUND_ERR=(s[8]="Not found",8);e.NOT_SUPPORTED_ERR=(s[9]="Not supported",9);var bl=e.INUSE_ATTRIBUTE_ERR=(s[10]="Attribute in use",10);e.INVALID_STATE_ERR=(s[11]="Invalid state",11);e.SYNTAX_ERR=(s[12]="Syntax error",12);e.INVALID_MODIFICATION_ERR=(s[13]="Invalid modification",13);e.NAMESPACE_ERR=(s[14]="Invalid namespace",14);e.INVALID_ACCESS_ERR=(s[15]="Invalid access",15);function A(e,t){if(t instanceof Error){var i=t}else{i=this;Error.call(this,s[e]);this.message=s[e];if(Error.captureStackTrace)Error.captureStackTrace(this,A)}i.code=e;if(t)this.message=this.message+": "+t;return i}A.prototype=Error.prototype;sl(e,A);function Tl(){}Tl.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],s=0;s<this.length;s++){uc(this[s],i,e,t)}return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function Sl(e,t){this._node=e;this._refresh=t;El(this)}function El(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);fc(e,"length",i.length);if(!e.$$length||i.length<e.$$length){for(var s=i.length;s in e;s++){if(Object.prototype.hasOwnProperty.call(e,s)){delete e[s]}}}sl(i,e);e._inc=t}}Sl.prototype.item=function(e){El(this);return this[e]||null};nl(Sl,Tl);function wl(){}function Il(e,t){var i=e.length;while(i--){if(e[i]===t){return i}}}function Cl(e,t,i,s){if(s){t[Il(t,s)]=i}else{t[t.length++]=i}if(e){i.ownerElement=e;var n=e.ownerDocument;if(n){s&&Rl(n,e,s);Pl(n,e,i)}}}function kl(e,t,i){var s=Il(t,i);if(s>=0){var n=t.length-1;while(s<n){t[s]=t[++s]}t.length=n;if(e){var r=e.ownerDocument;if(r){Rl(r,e,i);i.ownerElement=null}}}else{throw new A(vl,new Error(e.tagName+"@"+i))}}wl.prototype={length:0,item:Tl.prototype.item,getNamedItem:function(e){var t=this.length;while(t--){var i=this[t];if(i.nodeName==e){return i}}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement){throw new A(bl)}var i=this.getNamedItem(e.nodeName);Cl(this._ownerElement,this,e,i);return i},setNamedItemNS:function(e){var t=e.ownerElement,i;if(t&&t!=this._ownerElement){throw new A(bl)}i=this.getNamedItemNS(e.namespaceURI,e.localName);Cl(this._ownerElement,this,e,i);return i},removeNamedItem:function(e){var t=this.getNamedItem(e);kl(this._ownerElement,this,t);return t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);kl(this._ownerElement,this,i);return i},getNamedItemNS:function(e,t){var i=this.length;while(i--){var s=this[i];if(s.localName==t&&s.namespaceURI==e){return s}}return null}};function Al(){}Al.prototype={hasFeature:function(e,t){return true},createDocument:function(e,t,i){var s=new Ol;s.implementation=this;s.childNodes=new Tl;s.doctype=i||null;if(i){s.appendChild(i)}if(t){var n=s.createElementNS(e,t);s.appendChild(n)}return s},createDocumentType:function(e,t,i){var s=new ec;s.name=e;s.nodeName=e;s.publicId=t||"";s.systemId=i||"";return s}};function D(){}D.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return zl(this,e,t)},replaceChild:function(e,t){zl(this,e,t,Gl);if(t){this.removeChild(t)}},removeChild:function(e){return Nl(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return hc(this.ownerDocument||this,this,e)},normalize:function(){var e=this.firstChild;while(e){var t=e.nextSibling;if(t&&t.nodeType==ll&&e.nodeType==ll){this.removeChild(t);e.appendData(t.data)}else{e.normalize();e=t}}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){var t=this;while(t){var i=t._nsMap;if(i){for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===e){return s}}}t=t.nodeType==ol?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var i=t._nsMap;if(i){if(Object.prototype.hasOwnProperty.call(i,e)){return i[e]}}t=t.nodeType==ol?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function Dl(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}sl(rl,D);sl(rl,D.prototype);function xl(e,t){if(t(e)){return true}if(e=e.firstChild){do{if(xl(e,t)){return true}}while(e=e.nextSibling)}}function Ol(){this.ownerDocument=this}function Pl(e,t,i){e&&e._inc++;var s=i.namespaceURI;if(s===Qo.XMLNS){t._nsMap[i.prefix?i.localName:""]=i.value}}function Rl(e,t,i,s){e&&e._inc++;var n=i.namespaceURI;if(n===Qo.XMLNS){delete t._nsMap[i.prefix?i.localName:""]}}function Ll(e,t,i){if(e&&e._inc){e._inc++;var s=t.childNodes;if(i){s[s.length++]=i}else{var n=t.firstChild;var r=0;while(n){s[r++]=n;n=n.nextSibling}s.length=r;delete s[s.length]}}}function Nl(e,t){var i=t.previousSibling;var s=t.nextSibling;if(i){i.nextSibling=s}else{e.firstChild=s}if(s){s.previousSibling=i}else{e.lastChild=i}t.parentNode=null;t.previousSibling=null;t.nextSibling=null;Ll(e.ownerDocument,e);return t}function Ml(e){return e&&(e.nodeType===D.DOCUMENT_NODE||e.nodeType===D.DOCUMENT_FRAGMENT_NODE||e.nodeType===D.ELEMENT_NODE)}function Ul(e){return e&&(Fl(e)||ql(e)||Bl(e)||e.nodeType===D.DOCUMENT_FRAGMENT_NODE||e.nodeType===D.COMMENT_NODE||e.nodeType===D.PROCESSING_INSTRUCTION_NODE)}function Bl(e){return e&&e.nodeType===D.DOCUMENT_TYPE_NODE}function Fl(e){return e&&e.nodeType===D.ELEMENT_NODE}function ql(e){return e&&e.nodeType===D.TEXT_NODE}function jl(e,t){var i=e.childNodes||[];if(Ko(i,Fl)||Bl(t)){return false}var s=Ko(i,Bl);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function Vl(e,t){var i=e.childNodes||[];function s(e){return Fl(e)&&e!==t}if(Ko(i,s)){return false}var n=Ko(i,Bl);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function $l(e,t,i){if(!Ml(e)){throw new A(_l,"Unexpected parent node type "+e.nodeType)}if(i&&i.parentNode!==e){throw new A(vl,"child not in parent")}if(!Ul(t)||Bl(t)&&e.nodeType!==D.DOCUMENT_NODE){throw new A(_l,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}}function Hl(e,t,i){var s=e.childNodes||[];var n=t.childNodes||[];if(t.nodeType===D.DOCUMENT_FRAGMENT_NODE){var r=n.filter(Fl);if(r.length>1||Ko(n,ql)){throw new A(_l,"More than one element or text in fragment")}if(r.length===1&&!jl(e,i)){throw new A(_l,"Element in fragment can not be inserted before doctype")}}if(Fl(t)){if(!jl(e,i)){throw new A(_l,"Only one element can be added and only after doctype")}}if(Bl(t)){if(Ko(s,Bl)){throw new A(_l,"Only one doctype is allowed")}var a=Ko(s,Fl);if(i&&s.indexOf(a)<s.indexOf(i)){throw new A(_l,"Doctype can only be inserted before an element")}if(!i&&a){throw new A(_l,"Doctype can not be appended since element is present")}}}function Gl(e,t,i){var s=e.childNodes||[];var n=t.childNodes||[];if(t.nodeType===D.DOCUMENT_FRAGMENT_NODE){var r=n.filter(Fl);if(r.length>1||Ko(n,ql)){throw new A(_l,"More than one element or text in fragment")}if(r.length===1&&!Vl(e,i)){throw new A(_l,"Element in fragment can not be inserted before doctype")}}if(Fl(t)){if(!Vl(e,i)){throw new A(_l,"Only one element can be added and only after doctype")}}if(Bl(t)){function a(e){return Bl(e)&&e!==i}if(Ko(s,a)){throw new A(_l,"Only one doctype is allowed")}var o=Ko(s,Fl);if(i&&s.indexOf(o)<s.indexOf(i)){throw new A(_l,"Doctype can only be inserted before an element")}}}function zl(e,t,i,s){$l(e,t,i);if(e.nodeType===D.DOCUMENT_NODE){(s||Hl)(e,t,i)}var n=t.parentNode;if(n){n.removeChild(t)}if(t.nodeType===gl){var r=t.firstChild;if(r==null){return t}var a=t.lastChild}else{r=a=t}var o=i?i.previousSibling:e.lastChild;r.previousSibling=o;a.nextSibling=i;if(o){o.nextSibling=r}else{e.firstChild=r}if(i==null){e.lastChild=a}else{i.previousSibling=a}do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));Ll(e.ownerDocument||e,e);if(t.nodeType==gl){t.firstChild=t.lastChild=null}return t}function Wl(e,t){if(t.parentNode){t.parentNode.removeChild(t)}t.parentNode=e;t.previousSibling=e.lastChild;t.nextSibling=null;if(t.previousSibling){t.previousSibling.nextSibling=t}else{e.firstChild=t}e.lastChild=t;Ll(e.ownerDocument,e,t);return t}Ol.prototype={nodeName:"#document",nodeType:pl,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==gl){var i=e.firstChild;while(i){var s=i.nextSibling;this.insertBefore(i,t);i=s}return e}zl(this,e,t);e.ownerDocument=this;if(this.documentElement===null&&e.nodeType===al){this.documentElement=e}return e},removeChild:function(e){if(this.documentElement==e){this.documentElement=null}return Nl(this,e)},replaceChild:function(e,t){zl(this,e,t,Gl);e.ownerDocument=this;if(t){this.removeChild(t)}if(Fl(e)){this.documentElement=e}},importNode:function(e,t){return dc(this,e,t)},getElementById:function(t){var i=null;xl(this.documentElement,function(e){if(e.nodeType==al){if(e.getAttribute("id")==t){i=e;return true}}});return i},getElementsByClassName:function(a){var o=tl(a);return new Sl(this,function(n){var r=[];if(o.length>0){xl(n.documentElement,function(e){if(e!==n&&e.nodeType===al){var t=e.getAttribute("class");if(t){var i=a===t;if(!i){var s=tl(t);i=o.every(il(s))}if(i){r.push(e)}}}})}return r})},createElement:function(e){var t=new Yl;t.ownerDocument=this;t.nodeName=e;t.tagName=e;t.localName=e;t.childNodes=new Tl;var i=t.attributes=new wl;i._ownerElement=t;return t},createDocumentFragment:function(){var e=new nc;e.ownerDocument=this;e.childNodes=new Tl;return e},createTextNode:function(e){var t=new Ql;t.ownerDocument=this;t.appendData(e);return t},createComment:function(e){var t=new Jl;t.ownerDocument=this;t.appendData(e);return t},createCDATASection:function(e){var t=new Zl;t.ownerDocument=this;t.appendData(e);return t},createProcessingInstruction:function(e,t){var i=new rc;i.ownerDocument=this;i.tagName=i.nodeName=i.target=e;i.nodeValue=i.data=t;return i},createAttribute:function(e){var t=new Xl;t.ownerDocument=this;t.name=e;t.nodeName=e;t.localName=e;t.specified=true;return t},createEntityReference:function(e){var t=new sc;t.ownerDocument=this;t.nodeName=e;return t},createElementNS:function(e,t){var i=new Yl;var s=t.split(":");var n=i.attributes=new wl;i.childNodes=new Tl;i.ownerDocument=this;i.nodeName=t;i.tagName=t;i.namespaceURI=e;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=t}n._ownerElement=i;return i},createAttributeNS:function(e,t){var i=new Xl;var s=t.split(":");i.ownerDocument=this;i.nodeName=t;i.name=t;i.namespaceURI=e;i.specified=true;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=t}return i}};nl(Ol,D);function Yl(){this._nsMap={}}Yl.prototype={nodeType:al,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t;this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){if(e.nodeType===gl){return this.insertBefore(e,null)}else{return Wl(this,e)}},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var s=this.ownerDocument.createAttributeNS(e,t);s.value=s.nodeValue=""+i;this.setAttributeNode(s)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(s){return new Sl(this,function(t){var i=[];xl(t,function(e){if(e!==t&&e.nodeType==al&&(s==="*"||e.tagName==s)){i.push(e)}});return i})},getElementsByTagNameNS:function(s,n){return new Sl(this,function(t){var i=[];xl(t,function(e){if(e!==t&&e.nodeType===al&&(s==="*"||e.namespaceURI===s)&&(n==="*"||e.localName==n)){i.push(e)}});return i})}};Ol.prototype.getElementsByTagName=Yl.prototype.getElementsByTagName;Ol.prototype.getElementsByTagNameNS=Yl.prototype.getElementsByTagNameNS;nl(Yl,D);function Xl(){}Xl.prototype.nodeType=ol;nl(Xl,D);function Kl(){}Kl.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e;this.nodeValue=this.data=e;this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(s[_l])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var s=this.data.substring(0,e);var n=this.data.substring(e+t);i=s+i+n;this.nodeValue=this.data=i;this.length=i.length}};nl(Kl,D);function Ql(){}Ql.prototype={nodeName:"#text",nodeType:ll,splitText:function(e){var t=this.data;var i=t.substring(e);t=t.substring(0,e);this.data=this.nodeValue=t;this.length=t.length;var s=this.ownerDocument.createTextNode(i);if(this.parentNode){this.parentNode.insertBefore(s,this.nextSibling)}return s}};nl(Ql,Kl);function Jl(){}Jl.prototype={nodeName:"#comment",nodeType:fl};nl(Jl,Kl);function Zl(){}Zl.prototype={nodeName:"#cdata-section",nodeType:cl};nl(Zl,Kl);function ec(){}ec.prototype.nodeType=ml;nl(ec,D);function tc(){}tc.prototype.nodeType=yl;nl(tc,D);function ic(){}ic.prototype.nodeType=dl;nl(ic,D);function sc(){}sc.prototype.nodeType=ul;nl(sc,D);function nc(){}nc.prototype.nodeName="#document-fragment";nc.prototype.nodeType=gl;nl(nc,D);function rc(){}rc.prototype.nodeType=hl;nl(rc,D);function ac(){}ac.prototype.serializeToString=function(e,t,i){return oc.call(e,t,i)};D.prototype.toString=oc;function oc(e,t){var i=[];var s=this.nodeType==9&&this.documentElement||this;var n=s.prefix;var r=s.namespaceURI;if(r&&n==null){var n=s.lookupPrefix(r);if(n==null){var a=[{namespace:r,prefix:null}]}}uc(this,i,e,t,a);return i.join("")}function lc(e,t,i){var s=e.prefix||"";var n=e.namespaceURI;if(!n){return false}if(s==="xml"&&n===Qo.XML||n===Qo.XMLNS){return false}var r=i.length;while(r--){var a=i[r];if(a.prefix===s){return a.namespace!==n}}return true}function cc(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,Dl),'"')}function uc(e,t,i,s,n){if(!n){n=[]}if(s){e=s(e);if(e){if(typeof e=="string"){t.push(e);return}}else{return}}switch(e.nodeType){case al:var r=e.attributes;var a=r.length;var o=e.firstChild;var l=e.tagName;i=Qo.isHTML(e.namespaceURI)||i;var c=l;if(!i&&!e.prefix&&e.namespaceURI){var u;for(var d=0;d<r.length;d++){if(r.item(d).name==="xmlns"){u=r.item(d).value;break}}if(!u){for(var h=n.length-1;h>=0;h--){var f=n[h];if(f.prefix===""&&f.namespace===e.namespaceURI){u=f.namespace;break}}}if(u!==e.namespaceURI){for(var h=n.length-1;h>=0;h--){var f=n[h];if(f.namespace===e.namespaceURI){if(f.prefix){c=f.prefix+":"+l}break}}}}t.push("<",c);for(var p=0;p<a;p++){var m=r.item(p);if(m.prefix=="xmlns"){n.push({prefix:m.localName,namespace:m.value})}else if(m.nodeName=="xmlns"){n.push({prefix:"",namespace:m.value})}}for(var p=0;p<a;p++){var m=r.item(p);if(lc(m,i,n)){var g=m.prefix||"";var y=m.namespaceURI;cc(t,g?"xmlns:"+g:"xmlns",y);n.push({prefix:g,namespace:y})}uc(m,t,i,s,n)}if(l===c&&lc(e,i,n)){var g=e.prefix||"";var y=e.namespaceURI;cc(t,g?"xmlns:"+g:"xmlns",y);n.push({prefix:g,namespace:y})}if(o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){t.push(">");if(i&&/^script$/i.test(l)){while(o){if(o.data){t.push(o.data)}else{uc(o,t,i,s,n.slice())}o=o.nextSibling}}else{while(o){uc(o,t,i,s,n.slice());o=o.nextSibling}}t.push("</",c,">")}else{t.push("/>")}return;case pl:case gl:var o=e.firstChild;while(o){uc(o,t,i,s,n.slice());o=o.nextSibling}return;case ol:return cc(t,e.name,e.value);case ll:return t.push(e.data.replace(/[<&>]/g,Dl));case cl:return t.push("<![CDATA[",e.data,"]]>");case fl:return t.push("\x3c!--",e.data,"--\x3e");case ml:var _=e.publicId;var v=e.systemId;t.push("<!DOCTYPE ",e.name);if(_){t.push(" PUBLIC ",_);if(v&&v!="."){t.push(" ",v)}t.push(">")}else if(v&&v!="."){t.push(" SYSTEM ",v,">")}else{var b=e.internalSubset;if(b){t.push(" [",b,"]")}t.push(">")}return;case hl:return t.push("<?",e.target," ",e.data,"?>");case ul:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function dc(e,t,i){var s;switch(t.nodeType){case al:s=t.cloneNode(false);s.ownerDocument=e;case gl:break;case ol:i=true;break}if(!s){s=t.cloneNode(false)}s.ownerDocument=e;s.parentNode=null;if(i){var n=t.firstChild;while(n){s.appendChild(dc(e,n,i));n=n.nextSibling}}return s}function hc(e,t,i){var s=new t.constructor;for(var n in t){if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(typeof r!="object"){if(r!=s[n]){s[n]=r}}}}if(t.childNodes){s.childNodes=new Tl}s.ownerDocument=e;switch(s.nodeType){case al:var a=t.attributes;var o=s.attributes=new wl;var l=a.length;o._ownerElement=s;for(var c=0;c<l;c++){s.setAttributeNode(hc(e,a.item(c),true))}break;case ol:i=true}if(i){var u=t.firstChild;while(u){s.appendChild(hc(e,u,i));u=u.nextSibling}}return s}function fc(e,t,i){e[t]=i}try{if(Object.defineProperty){Object.defineProperty(Sl.prototype,"length",{get:function(){El(this);return this.$$length}});Object.defineProperty(D.prototype,"textContent",{get:function(){return pc(this)},set:function(e){switch(this.nodeType){case al:case gl:while(this.firstChild){this.removeChild(this.firstChild)}if(e||String(e)){this.appendChild(this.ownerDocument.createTextNode(e))}break;default:this.data=e;this.value=e;this.nodeValue=e}}});function pc(e){switch(e.nodeType){case al:case gl:var t=[];e=e.firstChild;while(e){if(e.nodeType!==7&&e.nodeType!==8){t.push(pc(e))}e=e.nextSibling}return t.join("");default:return e.nodeValue}}fc=function(e,t,i){e["$$"+t]=i}}}catch(e){}var mc=ec;var gc=A;var yc=Al;var _c=Yl;var vc=D;var bc=Tl;var Tc=ac;var Sc={DocumentType:mc,DOMException:gc,DOMImplementation:yc,Element:_c,Node:vc,NodeList:bc,XMLSerializer:Tc};var Ec=Li(function(e,t){var i=Xo.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});t.HTML_ENTITIES=i({Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"&",amp:"&",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8",breve:"\u02d8",brvbar:"\xa6",Bscr:"\u212c",bscr:"\ud835\udcb7",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"\u212d",cfr:"\ud835\udd20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\ud835\udd54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xa9",copy:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3",darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\xca",ecirc:"\xea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\ud835\udcbb",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:">",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\ud835\udd25",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\ud835\udd59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\ud835\udcbd",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",Ifr:"\u2111",ifr:"\ud835\udd26",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",Iscr:"\u2110",iscr:"\ud835\udcbe",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\ud835\udcc1",Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"<",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",Mscr:"\u2133",mscr:"\ud835\udcc2",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",nopf:"\ud835\udd5f",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",Popf:"\u2119",popf:"\ud835\udd61",pound:"\xa3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",Qopf:"\u211a",qopf:"\ud835\udd62",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\xae",reg:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\ud835\udd2f",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\ud835\udcc7",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",Uarr:"\u219f",uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\xff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\ud835\udd37",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\ud835\udd6b",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"});t.entityMap=t.HTML_ENTITIES});Ec.XML_ENTITIES;Ec.HTML_ENTITIES;Ec.entityMap;var wc=Xo.NAMESPACE;var Ic=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var Cc=new RegExp("[\\-\\.0-9"+Ic.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var kc=new RegExp("^"+Ic.source+Cc.source+"*(?::"+Ic.source+Cc.source+"*)?$");var Ac=0;var Dc=1;var xc=2;var Oc=3;var Pc=4;var Rc=5;var Lc=6;var Nc=7;function Mc(e,t){this.message=e;this.locator=t;if(Error.captureStackTrace)Error.captureStackTrace(this,Mc)}Mc.prototype=new Error;Mc.prototype.name=Mc.name;function Uc(){}Uc.prototype={parse:function(e,t,i){var s=this.domBuilder;s.startDocument();Hc(t,t={});Bc(e,t,i,s,this.errorHandler);s.endDocument()}};function Bc(i,e,s,n,r){function a(e){if(e>65535){e-=65536;var t=55296+(e>>10),i=56320+(e&1023);return String.fromCharCode(t,i)}else{return String.fromCharCode(e)}}function o(e){var t=e.slice(1,-1);if(Object.hasOwnProperty.call(s,t)){return s[t]}else if(t.charAt(0)==="#"){return a(parseInt(t.substr(1).replace("x","0x")))}else{r.error("entity not found:"+e);return e}}function t(e){if(e>m){var t=i.substring(m,e).replace(/&#?\w+;/g,o);h&&l(m);n.characters(t,0,e-m);m=e}}function l(e,t){while(e>=u&&(t=d.exec(i))){c=t.index;u=c+t[0].length;h.lineNumber++}h.columnNumber=e-c+1}var c=0;var u=0;var d=/.*(?:\r\n?|\n)|.*$/g;var h=n.locator;var f=[{currentNSMap:e}];var p={};var m=0;while(true){try{var g=i.indexOf("<",m);if(g<0){if(!i.substr(m).match(/^\s*$/)){var y=n.doc;var _=y.createTextNode(i.substr(m));y.appendChild(_);n.currentElement=_}return}if(g>m){t(g)}switch(i.charAt(g+1)){case"/":var v=i.indexOf(">",g+3);var b=i.substring(g+2,v).replace(/[ \t\n\r]+$/g,"");var T=f.pop();if(v<0){b=i.substring(g+2).replace(/[\s<].*/,"");r.error("end tag name: "+b+" is not complete:"+T.tagName);v=g+1+b.length}else if(b.match(/\s</)){b=b.replace(/[\s<].*/,"");r.error("end tag name: "+b+" maybe not complete");v=g+1+b.length}var S=T.localNSMap;var E=T.tagName==b;var w=E||T.tagName&&T.tagName.toLowerCase()==b.toLowerCase();if(w){n.endElement(T.uri,T.localName,b);if(S){for(var I in S){if(Object.prototype.hasOwnProperty.call(S,I)){n.endPrefixMapping(I)}}}if(!E){r.fatalError("end tag name: "+b+" is not match the current start tagName:"+T.tagName)}}else{f.push(T)}v++;break;case"?":h&&l(g);v=zc(i,g,n);break;case"!":h&&l(g);v=Gc(i,g,n,r);break;default:h&&l(g);var C=new Wc;var k=f[f.length-1].currentNSMap;var v=qc(i,g,C,k,o,r);var A=C.length;if(!C.closed&&$c(i,v,C.tagName,p)){C.closed=true;if(!s.nbsp){r.warning("unclosed xml attribute")}}if(h&&A){var D=Fc(h,{});for(var x=0;x<A;x++){var O=C[x];l(O.offset);O.locator=Fc(h,{})}n.locator=D;if(jc(C,n,k)){f.push(C)}n.locator=h}else{if(jc(C,n,k)){f.push(C)}}if(wc.isHTML(C.uri)&&!C.closed){v=Vc(i,v,C.tagName,o,n)}else{v++}}}catch(e){if(e instanceof Mc){throw e}r.error("element parse error: "+e);v=-1}if(v>m){m=v}else{t(Math.max(g,m)+1)}}}function Fc(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber;return t}function qc(e,t,s,i,n,r){function a(e,t,i){if(s.attributeNames.hasOwnProperty(e)){r.fatalError("Attribute "+e+" redefined")}s.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),i)}var o;var l;var c=++t;var u=Ac;while(true){var d=e.charAt(c);switch(d){case"=":if(u===Dc){o=e.slice(t,c);u=Oc}else if(u===xc){u=Oc}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(u===Oc||u===Dc){if(u===Dc){r.warning('attribute value must after "="');o=e.slice(t,c)}t=c+1;c=e.indexOf(d,t);if(c>0){l=e.slice(t,c);a(o,l,t-1);u=Rc}else{throw new Error("attribute value no end '"+d+"' match")}}else if(u==Pc){l=e.slice(t,c);a(o,l,t);r.warning('attribute "'+o+'" missed start quot('+d+")!!");t=c+1;u=Rc}else{throw new Error('attribute value must after "="')}break;case"/":switch(u){case Ac:s.setTagName(e.slice(t,c));case Rc:case Lc:case Nc:u=Nc;s.closed=true;case Pc:case Dc:break;case xc:s.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":r.error("unexpected end of input");if(u==Ac){s.setTagName(e.slice(t,c))}return c;case">":switch(u){case Ac:s.setTagName(e.slice(t,c));case Rc:case Lc:case Nc:break;case Pc:case Dc:l=e.slice(t,c);if(l.slice(-1)==="/"){s.closed=true;l=l.slice(0,-1)}case xc:if(u===xc){l=o}if(u==Pc){r.warning('attribute "'+l+'" missed quot(")!');a(o,l,t)}else{if(!wc.isHTML(i[""])||!l.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!')}a(l,l,t)}break;case Oc:throw new Error("attribute value missed!!")}return c;case"\x80":d=" ";default:if(d<=" "){switch(u){case Ac:s.setTagName(e.slice(t,c));u=Lc;break;case Dc:o=e.slice(t,c);u=xc;break;case Pc:var l=e.slice(t,c);r.warning('attribute "'+l+'" missed quot(")!!');a(o,l,t);case Rc:u=Lc;break}}else{switch(u){case xc:s.tagName;if(!wc.isHTML(i[""])||!o.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!')}a(o,o,t);t=c;u=Dc;break;case Rc:r.warning('attribute space is required"'+o+'"!!');case Lc:u=Dc;t=c;break;case Oc:u=Pc;t=c;break;case Nc:throw new Error("elements closed character '/' and '>' must be connected to")}}}c++}}function jc(e,t,i){var s=e.tagName;var n=null;var r=e.length;while(r--){var a=e[r];var o=a.qName;var l=a.value;var c=o.indexOf(":");if(c>0){var u=a.prefix=o.slice(0,c);var d=o.slice(c+1);var h=u==="xmlns"&&d}else{d=o;u=null;h=o==="xmlns"&&""}a.localName=d;if(h!==false){if(n==null){n={};Hc(i,i={})}i[h]=n[h]=l;a.uri=wc.XMLNS;t.startPrefixMapping(h,l)}}var r=e.length;while(r--){a=e[r];var u=a.prefix;if(u){if(u==="xml"){a.uri=wc.XML}if(u!=="xmlns"){a.uri=i[u||""]}}}var c=s.indexOf(":");if(c>0){u=e.prefix=s.slice(0,c);d=e.localName=s.slice(c+1)}else{u=null;d=e.localName=s}var f=e.uri=i[u||""];t.startElement(f,d,s,e);if(e.closed){t.endElement(f,d,s);if(n){for(u in n){if(Object.prototype.hasOwnProperty.call(n,u)){t.endPrefixMapping(u)}}}}else{e.currentNSMap=i;e.localNSMap=n;return true}}function Vc(e,t,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("</"+i+">",t);var a=e.substring(t+1,r);if(/[&<]/.test(a)){if(/^script$/i.test(i)){n.characters(a,0,a.length);return r}a=a.replace(/&#?\w+;/g,s);n.characters(a,0,a.length);return r}}return t+1}function $c(e,t,i,s){var n=s[i];if(n==null){n=e.lastIndexOf("</"+i+">");if(n<t){n=e.lastIndexOf("</"+i)}s[i]=n}return n<t}function Hc(e,t){for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t[i]=e[i]}}}function Gc(e,t,i,s){var n=e.charAt(t+2);switch(n){case"-":if(e.charAt(t+3)==="-"){var r=e.indexOf("--\x3e",t+4);if(r>t){i.comment(e,t+4,r-t-4);return r+3}else{s.error("Unclosed comment");return-1}}else{return-1}default:if(e.substr(t+3,6)=="CDATA["){var r=e.indexOf("]]>",t+9);i.startCDATA();i.characters(e,t+9,r-t-9);i.endCDATA();return r+3}var a=Yc(e,t);var o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0];var c=false;var u=false;if(o>3){if(/^public$/i.test(a[2][0])){c=a[3][0];u=o>4&&a[4][0]}else if(/^system$/i.test(a[2][0])){u=a[3][0]}}var d=a[o-1];i.startDTD(l,c,u);i.endDTD();return d.index+d[0].length}}return-1}function zc(e,t,i){var s=e.indexOf("?>",t);if(s){var n=e.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){n[0].length;i.processingInstruction(n[1],n[2]);return s+2}else{return-1}}return-1}function Wc(){this.attributeNames={}}Wc.prototype={setTagName:function(e){if(!kc.test(e)){throw new Error("invalid tagName:"+e)}this.tagName=e},addValue:function(e,t,i){if(!kc.test(e)){throw new Error("invalid attribute:"+e)}this.attributeNames[e]=this.length;this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function Yc(e,t){var i;var s=[];var n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;n.lastIndex=t;n.exec(e);while(i=n.exec(e)){s.push(i);if(i[1])return s}}var Xc=Uc;var Kc=Mc;var Qc={XMLReader:Xc,ParseError:Kc};var Jc=Sc.DOMImplementation;var Zc=Xo.NAMESPACE;var eu=Qc.ParseError;var tu=Qc.XMLReader;function iu(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function su(e){this.options=e||{locator:{}}}su.prototype.parseFromString=function(e,t){var i=this.options;var s=new tu;var n=i.domBuilder||new ru;var r=i.errorHandler;var a=i.locator;var o=i.xmlns||{};var l=/\/x?html?$/.test(t);var c=l?Ec.HTML_ENTITIES:Ec.XML_ENTITIES;if(a){n.setDocumentLocator(a)}s.errorHandler=nu(r,n,a);s.domBuilder=i.domBuilder||n;if(l){o[""]=Zc.HTML}o.xml=o.xml||Zc.XML;var u=i.normalizeLineEndings||iu;if(e&&typeof e==="string"){s.parse(u(e),o,c)}else{s.errorHandler.error("invalid doc source")}return n.doc};function nu(s,e,n){if(!s){if(e instanceof ru){return e}s=e}var r={};var a=s instanceof Function;n=n||{};function t(t){var i=s[t];if(!i&&a){i=s.length==2?function(e){s(t,e)}:s}r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+ou(n))}||function(){}}t("warning");t("error");t("fatalError");return r}function ru(){this.cdata=false}function au(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber}ru.prototype={startDocument:function(){this.doc=(new Jc).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,t,i,s){var n=this.doc;var r=n.createElementNS(e,i||t);var a=s.length;cu(this,r);this.currentElement=r;this.locator&&au(this.locator,r);for(var o=0;o<a;o++){var e=s.getURI(o);var l=s.getValue(o);var i=s.getQName(o);var c=n.createAttributeNS(e,i);this.locator&&au(s.getLocator(o),c);c.value=c.nodeValue=l;r.setAttributeNode(c)}},endElement:function(e,t,i){var s=this.currentElement;s.tagName;this.currentElement=s.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&au(this.locator,i);cu(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){e=lu.apply(this,arguments);if(e){if(this.cdata){var s=this.doc.createCDATASection(e)}else{var s=this.doc.createTextNode(e)}if(this.currentElement){this.currentElement.appendChild(s)}else if(/^\s*$/.test(e)){this.doc.appendChild(s)}this.locator&&au(this.locator,s)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){if(this.locator=e){e.lineNumber=0}},comment:function(e,t,i){e=lu.apply(this,arguments);var s=this.doc.createComment(e);this.locator&&au(this.locator,s);cu(this,s)},startCDATA:function(){this.cdata=true},endCDATA:function(){this.cdata=false},startDTD:function(e,t,i){var s=this.doc.implementation;if(s&&s.createDocumentType){var n=s.createDocumentType(e,t,i);this.locator&&au(this.locator,n);cu(this,n);this.doc.doctype=n}},warning:function(e){console.warn("[xmldom warning]\t"+e,ou(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,ou(this.locator))},fatalError:function(e){throw new eu(e,this.locator)}};function ou(e){if(e){return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}}function lu(e,t,i){if(typeof e=="string"){return e.substr(t,i)}else{if(e.length>=t+i||t){return new java.lang.String(e,t,i)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){ru.prototype[e]=function(){return null}});function cu(e,t){if(!e.currentElement){e.doc.appendChild(t)}else{e.currentElement.appendChild(t)}}var uu=ru;var du=iu;var hu=su;var fu={__DOMHandler:uu,normalizeLineEndings:du,DOMParser:hu};var pu=fu.DOMParser;const mu=e=>{return!!e&&typeof e==="object"};const x=(...e)=>{return e.reduce((t,i)=>{if(typeof i!=="object"){return t}Object.keys(i).forEach(e=>{if(Array.isArray(t[e])&&Array.isArray(i[e])){t[e]=t[e].concat(i[e])}else if(mu(t[e])&&mu(i[e])){t[e]=x(t[e],i[e])}else{t[e]=i[e]}});return t},{})};const gu=t=>Object.keys(t).map(e=>t[e]);const yu=(t,i)=>{const s=[];for(let e=t;e<i;e++){s.push(e)}return s};const _u=e=>e.reduce((e,t)=>e.concat(t),[]);const vu=t=>{if(!t.length){return[]}const i=[];for(let e=0;e<t.length;e++){i.push(t[e])}return i};const bu=(e,s)=>e.reduce((e,t,i)=>{if(t[s]){e.push(i)}return e},[]);const Tu=(e,i)=>{return gu(e.reduce((t,e)=>{e.forEach(e=>{t[i(e)]=e});return t},{}))};var Su={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Eu=({baseUrl:e="",source:t="",range:s="",indexRange:n=""})=>{const r={uri:t,resolvedUri:Ka(e||"",t)};if(s||n){const a=s?s:n;const o=a.split("-");let e=Ly.BigInt?Ly.BigInt(o[0]):parseInt(o[0],10);let t=Ly.BigInt?Ly.BigInt(o[1]):parseInt(o[1],10);if(e<Number.MAX_SAFE_INTEGER&&typeof e==="bigint"){e=Number(e)}if(t<Number.MAX_SAFE_INTEGER&&typeof t==="bigint"){t=Number(t)}let i;if(typeof t==="bigint"||typeof e==="bigint"){i=Ly.BigInt(t)-Ly.BigInt(e)+Ly.BigInt(1)}else{i=t-e+1}if(typeof i==="bigint"&&i<Number.MAX_SAFE_INTEGER){i=Number(i)}r.byterange={length:i,offset:e}}return r};const wu=e=>{let t;if(typeof e.offset==="bigint"||typeof e.length==="bigint"){t=Ly.BigInt(e.offset)+Ly.BigInt(e.length)-Ly.BigInt(1)}else{t=e.offset+e.length-1}return`${e.offset}-${t}`};const Iu=e=>{if(e&&typeof e!=="number"){e=parseInt(e,10)}if(isNaN(e)){return null}return e};const Cu={static(e){const{duration:t,timescale:i=1,sourceDuration:s,periodDuration:n}=e;const r=Iu(e.endNumber);const a=t/i;if(typeof r==="number"){return{start:0,end:r}}if(typeof n==="number"){return{start:0,end:n/a}}return{start:0,end:s/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=Infinity}=e;const c=Iu(e.endNumber);const u=(t+i)/1e3;const d=s+a;const h=u+o;const f=h-d;const p=Math.ceil(f*n/r);const m=Math.floor((u-d-l)*n/r);const g=Math.floor((u-d)*n/r);return{start:Math.max(0,m),end:typeof c==="number"?c:Math.min(p,g)}}};const ku=r=>e=>{const{duration:t,timescale:i=1,periodStart:s,startNumber:n=1}=r;return{number:n+e,duration:t/i,timeline:s,time:e*t}};const Au=e=>{const{type:t,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=e;const{start:a,end:o}=Cu[t](e);const l=yu(a,o).map(ku(e));if(t==="static"){const e=l.length-1;const c=typeof n==="number"?n:r;l[e].duration=c-i/s*e}return l};const Du=e=>{const{baseUrl:t,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t){throw new Error(Su.NO_BASE_URL)}const c=Eu({baseUrl:t,source:i.sourceURL,range:i.range});const u=Eu({baseUrl:t,source:t,indexRange:n});u.map=c;if(l){const d=Au(e);if(d.length){u.duration=d[0].duration;u.timeline=d[0].timeline}}else if(s){u.duration=s;u.timeline=r}u.presentationTime=a||r;u.number=o;return[u]};const xu=(e,s,n)=>{const r=e.sidx.map?e.sidx.map:null;const a=e.sidx.duration;const o=e.timeline||0;const t=e.sidx.byterange;const i=t.offset+t.length;const l=s.timescale;const c=s.references.filter(e=>e.referenceType!==1);const u=[];const d=e.endList?"static":"dynamic";const h=e.sidx.timeline;let f=h;let p=e.mediaSequence||0;let m;if(typeof s.firstOffset==="bigint"){m=Ly.BigInt(i)+s.firstOffset}else{m=i+s.firstOffset}for(let i=0;i<c.length;i++){const g=s.references[i];const y=g.referencedSize;const e=g.subsegmentDuration;let t;if(typeof m==="bigint"){t=m+Ly.BigInt(y)-Ly.BigInt(1)}else{t=m+y-1}const _=`${m}-${t}`;const v={baseUrl:n,timescale:l,timeline:o,periodStart:h,presentationTime:f,number:p,duration:e,sourceDuration:a,indexRange:_,type:d};const b=Du(v)[0];if(r){b.map=r}u.push(b);if(typeof m==="bigint"){m+=Ly.BigInt(y)}else{m+=y}f+=e/l;p++}e.segments=u;return e};const Ou=["AUDIO","SUBTITLES"];const Pu=1/60;const Ru=e=>{return Tu(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1)};const Lu=(t,i)=>{for(let e=0;e<t.length;e++){if(t[e].attributes.NAME===i){return t[e]}}return null};const Nu=e=>{let n=[];Mo(e,Ou,(e,t,i,s)=>{n=n.concat(e.playlists||[])});return n};const Mu=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e;i.segments.forEach((e,t)=>{e.number=i.mediaSequence+t})};const Uu=({oldPlaylists:r,newPlaylists:e,timelineStarts:a})=>{e.forEach(t=>{t.discontinuitySequence=a.findIndex(function({timeline:e}){return e===t.timeline});const e=Lu(r,t.attributes.NAME);if(!e){return}if(t.sidx){return}const i=t.segments[0];const s=e.segments.findIndex(function(e){return Math.abs(e.presentationTime-i.presentationTime)<Pu});if(s===-1){Mu({playlist:t,mediaSequence:e.mediaSequence+e.segments.length});t.segments[0].discontinuity=true;t.discontinuityStarts.unshift(0);if(!e.segments.length&&t.timeline>e.timeline||e.segments.length&&t.timeline>e.segments[e.segments.length-1].timeline){t.discontinuitySequence--}return}const n=e.segments[s];if(n.discontinuity&&!i.discontinuity){i.discontinuity=true;t.discontinuityStarts.unshift(0);t.discontinuitySequence--}Mu({playlist:t,mediaSequence:e.segments[s].number})})};const Bu=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(Nu(e));const s=t.playlists.concat(Nu(t));t.timelineStarts=Ru([e.timelineStarts,t.timelineStarts]);Uu({oldPlaylists:i,newPlaylists:s,timelineStarts:t.timelineStarts});return t};const Fu=e=>e&&e.uri+"-"+wu(e.byterange);const qu=e=>{const t=e.reduce(function(e,t){if(!e[t.attributes.baseUrl]){e[t.attributes.baseUrl]=[]}e[t.attributes.baseUrl].push(t);return e},{});let i=[];Object.values(t).forEach(e=>{const t=gu(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");if(!e[i]){e[i]=t;e[i].attributes.timelineStarts=[]}else{if(t.segments){if(t.segments[0]){t.segments[0].discontinuity=true}e[i].segments.push(...t.segments)}if(t.attributes.contentProtection){e[i].attributes.contentProtection=t.attributes.contentProtection}}e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart});return e},{}));i=i.concat(t)});return i.map(e=>{e.discontinuityStarts=bu(e.segments||[],"discontinuity");return e})};const ju=(e,t)=>{const i=Fu(e.sidx);const s=i&&t[i]&&t[i].sidx;if(s){xu(e,s,e.sidx.resolvedUri)}return e};const Vu=(e,t={})=>{if(!Object.keys(t).length){return e}for(const i in e){e[i]=ju(e[i],t)}return e};const $u=({attributes:e,segments:t,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:s,segments:t};if(e.contentProtection){o.contentProtection=e.contentProtection}if(e.serviceLocation){o.attributes.serviceLocation=e.serviceLocation}if(i){o.sidx=i}if(a){o.attributes.AUDIO="audio";o.attributes.SUBTITLES="subs"}return o};const Hu=({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{if(typeof t==="undefined"){t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}];e.duration=e.sourceDuration}const r={NAME:e.id,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1};if(e.codecs){r.CODECS=e.codecs}const a={attributes:r,uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:t};if(e.serviceLocation){a.attributes.serviceLocation=e.serviceLocation}return a};const Gu=(e,o={},l=false)=>{let c;const t=e.reduce((e,t)=>{const i=t.attributes.role&&t.attributes.role.value||"";const s=t.attributes.lang||"";let n=t.attributes.label||"main";if(s&&!t.attributes.label){const a=i?` (${i})`:"";n=`${t.attributes.lang}${a}`}if(!e[n]){e[n]={language:s,autoselect:true,default:i==="main",playlists:[],uri:""}}const r=ju($u(t,l),o);e[n].playlists.push(r);if(typeof c==="undefined"&&i==="main"){c=t;c.default=true}return e},{});if(!c){const i=Object.keys(t)[0];t[i].default=true}return t};const zu=(e,s={})=>{return e.reduce((e,t)=>{const i=t.attributes.label||t.attributes.lang||"text";if(!e[i]){e[i]={language:i,default:false,autoselect:false,playlists:[],uri:""}}e[i].playlists.push(ju(Hu(t),s));return e},{})};const Wu=e=>e.reduce((s,e)=>{if(!e){return s}e.forEach(e=>{const{channel:t,language:i}=e;s[i]={autoselect:false,default:false,instreamId:t,language:i};if(e.hasOwnProperty("aspectRatio")){s[i].aspectRatio=e.aspectRatio}if(e.hasOwnProperty("easyReader")){s[i].easyReader=e.easyReader}if(e.hasOwnProperty("3D")){s[i]["3D"]=e["3D"]}});return s},{});const Yu=({attributes:e,segments:t,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:s,timelineStarts:e.timelineStarts,segments:t};if(e.frameRate){n.attributes["FRAME-RATE"]=e.frameRate}if(e.contentProtection){n.contentProtection=e.contentProtection}if(e.serviceLocation){n.attributes.serviceLocation=e.serviceLocation}if(i){n.sidx=i}return n};const Xu=({attributes:e})=>e.mimeType==="video/mp4"||e.mimeType==="video/webm"||e.contentType==="video";const Ku=({attributes:e})=>e.mimeType==="audio/mp4"||e.mimeType==="audio/webm"||e.contentType==="audio";const Qu=({attributes:e})=>e.mimeType==="text/vtt"||e.contentType==="text";const Ju=(e,i)=>{e.forEach(t=>{t.mediaSequence=0;t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});if(!t.segments){return}t.segments.forEach((e,t)=>{e.number=t})})};const Zu=s=>{if(!s){return[]}return Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[])};const ed=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!e.length){return{}}const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:c}=e[0].attributes;const u=qu(e.filter(Xu)).map(Yu);const d=qu(e.filter(Ku));const h=qu(e.filter(Qu));const f=e.map(e=>e.attributes.captionServices).filter(Boolean);const p={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:a,playlists:Vu(u,s)};if(c>=0){p.minimumUpdatePeriod=c*1e3}if(t){p.locations=t}if(i){p.contentSteering=i}if(o==="dynamic"){p.suggestedPresentationDelay=l}if(r&&r.length>0){p.eventStream=r}const m=p.playlists.length===0;const g=d.length?Gu(d,s,m):null;const y=h.length?zu(h,s):null;const _=u.concat(Zu(g),Zu(y));const v=_.map(({timelineStarts:e})=>e);p.timelineStarts=Ru(v);Ju(_,p.timelineStarts);if(g){p.mediaGroups.AUDIO.audio=g}if(y){p.mediaGroups.SUBTITLES.subs=y}if(f.length){p.mediaGroups["CLOSED-CAPTIONS"].cc=Wu(f)}if(n){return Bu({oldManifest:n,newManifest:p})}return p};const td=(e,t,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e;const c=(s+n)/1e3;const u=r+o;const d=c+l;const h=d-u;return Math.ceil((h*a-t)/i)};const id=(n,r)=>{const{type:a,minimumUpdatePeriod:o=0,media:l="",sourceDuration:c,timescale:u=1,startNumber:d=1,periodStart:h}=n;const f=[];let p=-1;for(let s=0;s<r.length;s++){const m=r[s];const e=m.d;const g=m.r||0;const y=m.t||0;if(p<0){p=y}if(y&&y>p){p=y}let t;if(g<0){const v=s+1;if(v===r.length){if(a==="dynamic"&&o>0&&l.indexOf("$Number$")>0){t=td(n,p,e)}else{t=(c*u-p)/e}}else{t=(r[v].t-p)/e}}else{t=g+1}const _=d+f.length+t;let i=d+f.length;while(i<_){f.push({number:i,duration:e/u,time:p,timeline:h});p+=e;i++}}return f};const sd=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;const nd=r=>(e,t,i,s)=>{if(e==="$$"){return"$"}if(typeof r[t]==="undefined"){return e}const n=""+r[t];if(t==="RepresentationID"){return n}if(!i){s=1}else{s=parseInt(s,10)}if(n.length>=s){return n}return`${new Array(s-n.length+1).join("0")}${n}`};const rd=(e,t)=>e.replace(sd,nd(t));const ad=(e,t)=>{if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}if(e.duration){return Au(e)}return id(e,t)};const od=(a,e)=>{const o={RepresentationID:a.id,Bandwidth:a.bandwidth||0};const{initialization:t={sourceURL:"",range:""}}=a;const l=Eu({baseUrl:a.baseUrl,source:rd(t.sourceURL,o),range:t.range});const i=ad(a,e);return i.map(e=>{o.Number=e.number;o.Time=e.time;const t=rd(a.media||"",o);const i=a.timescale||1;const s=a.presentationTimeOffset||0;const n=a.periodStart+(e.time-s)/i;const r={uri:t,timeline:e.timeline,duration:e.duration,resolvedUri:Ka(a.baseUrl||"",t),map:l,number:e.number,presentationTime:n};return r})};const ld=(e,t)=>{const{baseUrl:i,initialization:s={}}=e;const n=Eu({baseUrl:i,source:s.sourceURL,range:s.range});const r=Eu({baseUrl:i,source:t.media,range:t.mediaRange});r.map=n;return r};const cd=(r,e)=>{const{duration:t,segmentUrls:i=[],periodStart:a}=r;if(!t&&!e||t&&e){throw new Error(Su.SEGMENT_TIME_UNSPECIFIED)}const o=i.map(e=>ld(r,e));let s;if(t){s=Au(r)}if(e){s=id(r,e)}const n=s.map((e,t)=>{if(o[t]){const i=o[t];const s=r.timescale||1;const n=r.presentationTimeOffset||0;i.timeline=e.timeline;i.duration=e.duration;i.number=e.number;i.presentationTime=a+(e.time-n)/s;return i}}).filter(e=>e);return n};const ud=({attributes:e,segmentInfo:t})=>{let i;let s;if(t.template){s=od;i=x(e,t.template)}else if(t.base){s=Du;i=x(e,t.base)}else if(t.list){s=cd;i=x(e,t.list)}const n={attributes:e};if(!s){return n}const r=s(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:a=1}=i;i.duration=e/a}else if(r.length){i.duration=r.reduce((e,t)=>{return Math.max(e,Math.ceil(t.duration))},0)}else{i.duration=0}n.attributes=i;n.segments=r;if(t.base&&i.indexRange){n.sidx=r[0];n.segments=[]}return n};const dd=e=>e.map(ud);const O=(e,t)=>vu(e.childNodes).filter(({tagName:e})=>e===t);const hd=e=>e.textContent.trim();const fd=e=>{return parseFloat(e.split("/").reduce((e,t)=>e/t))};const pd=e=>{const t=365*24*60*60;const i=30*24*60*60;const s=24*60*60;const n=60*60;const r=60;const a=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;const o=a.exec(e);if(!o){return 0}const[l,c,u,d,h,f]=o.slice(1);return parseFloat(l||0)*t+parseFloat(c||0)*i+parseFloat(u||0)*s+parseFloat(d||0)*n+parseFloat(h||0)*r+parseFloat(f||0)};const md=e=>{const t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(t.test(e)){e+="Z"}return Date.parse(e)};const gd={mediaPresentationDuration(e){return pd(e)},availabilityStartTime(e){return md(e)/1e3},minimumUpdatePeriod(e){return pd(e)},suggestedPresentationDelay(e){return pd(e)},type(e){return e},timeShiftBufferDepth(e){return pd(e)},start(e){return pd(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return fd(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){const t=parseInt(e,10);if(isNaN(t)){return pd(e)}return t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},DEFAULT(e){return e}};const P=e=>{if(!(e&&e.attributes)){return{}}return vu(e.attributes).reduce((e,t)=>{const i=gd[t.name]||gd.DEFAULT;e[t.name]=i(t.value);return e},{})};const yd={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"};const _d=(e,t)=>{if(!t.length){return e}return _u(e.map(function(n){return t.map(function(e){const t=hd(e);const i=Ka(n.baseUrl,t);const s=x(P(e),{baseUrl:i});if(i!==t&&!s.serviceLocation&&n.serviceLocation){s.serviceLocation=n.serviceLocation}return s})}))};const vd=e=>{const t=O(e,"SegmentTemplate")[0];const i=O(e,"SegmentList")[0];const s=i&&O(i,"SegmentURL").map(e=>x({tag:"SegmentURL"},P(e)));const n=O(e,"SegmentBase")[0];const r=i||t;const a=r&&O(r,"SegmentTimeline")[0];const o=i||n||t;const l=o&&O(o,"Initialization")[0];const c=t&&P(t);if(c&&l){c.initialization=l&&P(l)}else if(c&&c.initialization){c.initialization={sourceURL:c.initialization}}const u={template:c,segmentTimeline:a&&O(a,"S").map(e=>P(e)),list:i&&x(P(i),{segmentUrls:s,initialization:P(l)}),base:n&&x(P(n),{initialization:P(l)})};Object.keys(u).forEach(e=>{if(!u[e]){delete u[e]}});return u};const bd=(r,a,o)=>e=>{const t=O(e,"BaseURL");const i=_d(a,t);const s=x(r,P(e));const n=vd(e);return i.map(e=>{return{segmentInfo:x(o,n),attributes:x(s,e)}})};const Td=e=>{return e.reduce((e,t)=>{const i=P(t);if(i.schemeIdUri){i.schemeIdUri=i.schemeIdUri.toLowerCase()}const s=yd[i.schemeIdUri];if(s){e[s]={attributes:i};const n=O(t,"cenc:pssh")[0];if(n){const r=hd(n);e[s].pssh=r&&Bo(r)}}return e},{})};const Sd=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map(e=>{let t;let i;i=e;if(/^CC\d=/.test(e)){[t,i]=e.split("=")}else if(/^CC\d$/.test(e)){t=e}return{channel:t,language:i}})}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map(e=>{const s={channel:undefined,language:undefined,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[t,i=""]=e.split("=");s.channel=t;s.language=e;i.split(",").forEach(e=>{const[t,i]=e.split(":");if(t==="lang"){s.language=i}else if(t==="er"){s.easyReader=Number(i)}else if(t==="war"){s.aspectRatio=Number(i)}else if(t==="3D"){s["3D"]=Number(i)}})}else{s.language=e}if(s.channel){s.channel="SERVICE"+s.channel}return s})}};const Ed=l=>{return _u(O(l.node,"EventStream").map(e=>{const a=P(e);const o=a.schemeIdUri;return O(e,"Event").map(e=>{const t=P(e);const i=t.presentationTime||0;const s=a.timescale||1;const n=t.duration||0;const r=i/s+l.attributes.start;return{schemeIdUri:o,value:a.value,id:t.id,start:r,end:r+n/s,messageData:hd(e)||t.messageData,contentEncoding:a.contentEncoding,presentationTimeOffset:a.presentationTimeOffset||0}})}))};const wd=(p,m,g)=>e=>{const t=P(e);const i=_d(m,O(e,"BaseURL"));const s=O(e,"Role")[0];const n={role:P(s)};let r=x(p,t,n);const a=O(e,"Accessibility")[0];const o=Sd(P(a));if(o){r=x(r,{captionServices:o})}const l=O(e,"Label")[0];if(l&&l.childNodes.length){const f=l.childNodes[0].nodeValue.trim();r=x(r,{label:f})}const c=Td(O(e,"ContentProtection"));if(Object.keys(c).length){r=x(r,{contentProtection:c})}const u=vd(e);const d=O(e,"Representation");const h=x(g,u);return _u(d.map(bd(r,i,h)))};const Id=(a,o)=>(e,t)=>{const i=_d(o,O(e.node,"BaseURL"));const s=x(a,{periodStart:e.attributes.start});if(typeof e.attributes.duration==="number"){s.periodDuration=e.attributes.duration}const n=O(e.node,"AdaptationSet");const r=vd(e.node);return _u(n.map(wd(s,i,r)))};const Cd=(e,t)=>{if(e.length>1){t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"})}if(!e.length){return null}const i=x({serverURL:hd(e[0])},P(e[0]));i.queryBeforeStart=i.queryBeforeStart==="true";return i};const kd=({attributes:e,priorPeriodAttributes:t,mpdType:i})=>{if(typeof e.start==="number"){return e.start}if(t&&typeof t.start==="number"&&typeof t.duration==="number"){return t.start+t.duration}if(!t&&i==="static"){return 0}return null};const Ad=(e,t={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=t;const a=O(e,"Period");if(!a.length){throw new Error(Su.INVALID_NUMBER_OF_PERIOD)}const o=O(e,"Location");const l=P(e);const c=_d([{baseUrl:i}],O(e,"BaseURL"));const u=O(e,"ContentSteering");l.type=l.type||"static";l.sourceDuration=l.mediaPresentationDuration||0;l.NOW=s;l.clientOffset=n;if(o.length){l.locations=o.map(hd)}const d=[];a.forEach((e,t)=>{const i=P(e);const s=d[t-1];i.start=kd({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:l.type});d.push({node:e,attributes:i})});return{locations:l.locations,contentSteeringInfo:Cd(u,r),representationInfo:_u(d.map(Id(l,c))),eventStream:_u(d.map(Ed))}};const Dd=e=>{if(e===""){throw new Error(Su.DASH_EMPTY_MANIFEST)}const t=new pu;let i;let s;try{i=t.parseFromString(e,"application/xml");s=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch(e){}if(!s||s&&s.getElementsByTagName("parsererror").length>0){throw new Error(Su.DASH_INVALID_XML)}return s};const xd=e=>{const t=O(e,"UTCTiming")[0];if(!t){return null}const i=P(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT";i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Su.UNSUPPORTED_UTC_TIMING_SCHEME)}return i};const Od=(e,t={})=>{const i=Ad(Dd(e),t);const s=dd(i.representationInfo);return ed({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})};const Pd=e=>xd(Dd(e));var Rd=Math.pow(2,32);var Ld=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);var i;if(t.getBigUint64){i=t.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return t.getUint32(0)*Rd+t.getUint32(4)};var Nd={getUint64:Ld,MAX_UINT32:Rd};var Md=Nd.getUint64;var Ud=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},s=12;if(i.version===0){i.earliestPresentationTime=t.getUint32(s);i.firstOffset=t.getUint32(s+4);s+=8}else{i.earliestPresentationTime=Md(e.subarray(s));i.firstOffset=Md(e.subarray(s+8));s+=16}s+=2;var n=t.getUint16(s);s+=2;for(;n>0;s+=12,n--){i.references.push({referenceType:(e[s]&128)>>>7,referencedSize:t.getUint32(s)&2147483647,subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(e[s+8]&128),sapType:(e[s+8]&112)>>>4,sapDeltaTime:t.getUint32(s+8)&268435455})}return i};var Bd=Ud;var Fd=w([73,68,51]);var qd=function e(t,i){if(i===void 0){i=0}t=w(t);var s=t[i+5];var n=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];var r=(s&16)>>4;if(r){return n+20}return n+10};var jd=function e(t,i){if(i===void 0){i=0}t=w(t);if(t.length-i<10||!k(t,Fd,{offset:i})){return i}i+=qd(t,i);return e(t,i)};var Vd=function e(t){if(typeof t==="string"){return Lo(t)}if(typeof t==="number"){return t}return t};var $d=function e(t){if(!Array.isArray(t)){return[Vd(t)]}return t.map(function(e){return Vd(e)})};var Hd=function e(t,i,s){if(s===void 0){s=false}i=$d(i);t=w(t);var n=[];if(!i.length){return n}var r=0;while(r<t.length){var a=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0;var o=t.subarray(r+4,r+8);if(a===0){break}var l=r+a;if(l>t.length){if(s){break}l=t.length}var c=t.subarray(r+8,l);if(k(o,i[0])){if(i.length===1){n.push(c)}else{n.push.apply(n,e(c,i.slice(1),s))}}r=l}return n};var Gd={EBML:w([26,69,223,163]),DocType:w([66,130]),Segment:w([24,83,128,103]),SegmentInfo:w([21,73,169,102]),Tracks:w([22,84,174,107]),Track:w([174]),TrackNumber:w([215]),DefaultDuration:w([35,227,131]),TrackEntry:w([174]),TrackType:w([131]),FlagDefault:w([136]),CodecID:w([134]),CodecPrivate:w([99,162]),VideoTrack:w([224]),AudioTrack:w([225]),Cluster:w([31,67,182,117]),Timestamp:w([231]),TimestampScale:w([42,215,177]),BlockGroup:w([160]),BlockDuration:w([155]),Block:w([161]),SimpleBlock:w([163])};var zd=[128,64,32,16,8,4,2,1];var Wd=function e(t){var i=1;for(var s=0;s<zd.length;s++){if(t&zd[s]){break}i++}return i};var Yd=function e(t,i,s,n){if(s===void 0){s=true}if(n===void 0){n=false}var r=Wd(t[i]);var a=t.subarray(i,i+r);if(s){a=Array.prototype.slice.call(t,i,i+r);a[0]^=zd[r-1]}return{length:r,value:Po(a,{signed:n}),bytes:a}};var Xd=function t(e){if(typeof e==="string"){return e.match(/.{1,2}/g).map(function(e){return t(e)})}if(typeof e==="number"){return Ro(e)}return e};var Kd=function e(t){if(!Array.isArray(t)){return[Xd(t)]}return t.map(function(e){return Xd(e)})};var Qd=function e(t,i,s){if(s>=i.length){return i.length}var n=Yd(i,s,false);if(k(t.bytes,n.bytes)){return s}var r=Yd(i,s+n.length);return e(t,i,s+r.length+r.value+n.length)};var Jd=function e(t,i){i=Kd(i);t=w(t);var s=[];if(!i.length){return s}var n=0;while(n<t.length){var r=Yd(t,n,false);var a=Yd(t,n+r.length);var o=n+r.length+a.length;if(a.value===127){a.value=Qd(r,t,o);if(a.value!==t.length){a.value-=o}}var l=o+a.value>t.length?t.length:o+a.value;var c=t.subarray(o,l);if(k(i[0],r.bytes)){if(i.length===1){s.push(c)}else{s=s.concat(e(c,i.slice(1)))}}var u=r.length+a.length+c.length;n+=u}return s};var Zd=w([0,0,0,1]);var eh=w([0,0,1]);var th=w([0,0,3]);var ih=function e(t){var i=[];var s=1;while(s<t.length-2){if(k(t.subarray(s,s+3),th)){i.push(s+2);s++}s++}if(i.length===0){return t}var n=t.length-i.length;var r=new Uint8Array(n);var a=0;for(s=0;s<n;a++,s++){if(a===i[0]){a++;i.shift()}r[s]=t[a]}return r};var sh=function e(t,i,s,n){if(n===void 0){n=Infinity}t=w(t);s=[].concat(s);var r=0;var a;var o=0;while(r<t.length&&(o<n||a)){var l=void 0;if(k(t.subarray(r),Zd)){l=4}else if(k(t.subarray(r),eh)){l=3}if(!l){r++;continue}o++;if(a){return ih(t.subarray(a,r))}var c=void 0;if(i==="h264"){c=t[r+l]&31}else if(i==="h265"){c=t[r+l]>>1&63}if(s.indexOf(c)!==-1){a=r+l}r+=l+(i==="h264"?1:2)}return t.subarray(0,0)};var nh=function e(t,i,s){return sh(t,"h264",i,s)};var rh=function e(t,i,s){return sh(t,"h265",i,s)};var n={webm:w([119,101,98,109]),matroska:w([109,97,116,114,111,115,107,97]),flac:w([102,76,97,67]),ogg:w([79,103,103,83]),ac3:w([11,119]),riff:w([82,73,70,70]),avi:w([65,86,73]),wav:w([87,65,86,69]),"3gp":w([102,116,121,112,51,103]),mp4:w([102,116,121,112]),fmp4:w([115,116,121,112]),mov:w([102,116,121,112,113,116]),moov:w([109,111,111,118]),moof:w([109,111,111,102])};var ah={aac:function e(t){var i=jd(t);return k(t,[255,16],{offset:i,mask:[255,22]})},mp3:function e(t){var i=jd(t);return k(t,[255,2],{offset:i,mask:[255,6]})},webm:function e(t){var i=Jd(t,[Gd.EBML,Gd.DocType])[0];return k(i,n.webm)},mkv:function e(t){var i=Jd(t,[Gd.EBML,Gd.DocType])[0];return k(i,n.matroska)},mp4:function e(t){if(ah["3gp"](t)||ah.mov(t)){return false}if(k(t,n.mp4,{offset:4})||k(t,n.fmp4,{offset:4})){return true}if(k(t,n.moof,{offset:4})||k(t,n.moov,{offset:4})){return true}},mov:function e(t){return k(t,n.mov,{offset:4})},"3gp":function e(t){return k(t,n["3gp"],{offset:4})},ac3:function e(t){var i=jd(t);return k(t,n.ac3,{offset:i})},ts:function e(t){if(t.length<189&&t.length>=1){return t[0]===71}var i=0;while(i+188<t.length&&i<188){if(t[i]===71&&t[i+188]===71){return true}i+=1}return false},flac:function e(t){var i=jd(t);return k(t,n.flac,{offset:i})},ogg:function e(t){return k(t,n.ogg)},avi:function e(t){return k(t,n.riff)&&k(t,n.avi,{offset:8})},wav:function e(t){return k(t,n.riff)&&k(t,n.wav,{offset:8})},h264:function e(t){return nh(t,7,3).length},h265:function e(t){return rh(t,[32,33],3).length}};var oh=Object.keys(ah).filter(function(e){return e!=="ts"&&e!=="h264"&&e!=="h265"}).concat(["ts","h264","h265"]);oh.forEach(function(e){var t=ah[e];ah[e]=function(e){return t(w(e))}});var lh=ah;var ch=function e(t){t=w(t);for(var i=0;i<oh.length;i++){var s=oh[i];if(lh[s](t)){return s}}return""};var uh=function e(t){return Hd(t,["moof"]).length>0};var dh=9e4,hh,fh,ph,mh,gh,yh,_h;hh=function(e){return e*dh};fh=function(e,t){return e*t};ph=function(e){return e/dh};mh=function(e,t){return e/t};gh=function(e,t){return hh(mh(e,t))};yh=function(e,t){return fh(ph(e),t)};_h=function(e,t,i){return ph(i?e:e-t)};var vh={ONE_SECOND_IN_TS:dh,secondsToVideoTs:hh,secondsToAudioTs:fh,videoTsToSeconds:ph,audioTsToSeconds:mh,audioTsToVideoTs:gh,videoTsToAudioTs:yh,metadataTsToSeconds:_h};var bh=vh.ONE_SECOND_IN_TS;const Th=Ka;const Sh=(e,t)=>{if(t&&t.responseURL&&e!==t.responseURL){return t.responseURL}return e};const Eh=e=>{if(C.log.debug){return C.log.debug.bind(C,"VHS:",`${e} >`)}return function(){}};function M(...e){const t=C.obj||C;const i=t.merge||t.mergeOptions;return i.apply(t,e)}function R(...e){const t=C.time||C;const i=t.createTimeRanges||t.createTimeRanges;return i.apply(t,e)}function wh(t){if(t.length===0){return"Buffered Ranges are empty"}let i="Buffered Ranges: \n";for(let e=0;e<t.length;e++){const s=t.start(e);const n=t.end(e);i+=`${s} --> ${n}. Duration (${n-s})\n`}return i}const Ih=1/30;const Ch=Ih*3;const kh=function(e,t){const i=[];let s;if(e&&e.length){for(s=0;s<e.length;s++){if(t(e.start(s),e.end(s))){i.push([e.start(s),e.end(s)])}}}return R(i)};const Ah=function(e,i){return kh(e,function(e,t){return e-Ch<=i&&t+Ch>=i})};const Dh=function(e,t){return kh(e,function(e){return e-Ih>=t})};const xh=function(t){if(t.length<2){return R()}const i=[];for(let e=1;e<t.length;e++){const s=t.end(e-1);const n=t.start(e);i.push([s,n])}return R(i)};const Oh=function(e,t){let i=null;let s=null;let n=0;const r=[];const a=[];if(!e||!e.length||!t||!t.length){return R()}let o=e.length;while(o--){r.push({time:e.start(o),type:"start"});r.push({time:e.end(o),type:"end"})}o=t.length;while(o--){r.push({time:t.start(o),type:"start"});r.push({time:t.end(o),type:"end"})}r.sort(function(e,t){return e.time-t.time});for(o=0;o<r.length;o++){if(r[o].type==="start"){n++;if(n===2){i=r[o].time}}else if(r[o].type==="end"){n--;if(n===1){s=r[o].time}}if(i!==null&&s!==null){a.push([i,s]);i=null;s=null}}return R(a)};const Ph=t=>{const i=[];if(!t||!t.length){return""}for(let e=0;e<t.length;e++){i.push(t.start(e)+" => "+t.end(e))}return i.join(", ")};const Rh=function(e,t,i=1){const s=e.length?e.end(e.length-1):0;return(s-t)/i};const Lh=t=>{const i=[];for(let e=0;e<t.length;e++){i.push({start:t.start(e),end:t.end(e)})}return i};const Nh=function(t,i){if(t===i){return false}if(!t&&i||!i&&t){return true}if(t.length!==i.length){return true}for(let e=0;e<t.length;e++){if(t.start(e)!==i.start(e)||t.end(e)!==i.end(e)){return true}}return false};const Mh=function(e){if(!e||!e.length||!e.end){return}return e.end(e.length-1)};const Uh=function(t,i){let s=0;if(!t||!t.length){return s}for(let e=0;e<t.length;e++){const n=t.start(e);const r=t.end(e);if(i>r){continue}if(i>n&&i<=r){s+=r-i;continue}s+=r-n}return s};const Bh=(t,e)=>{if(!e.preload){return e.duration}let i=0;(e.parts||[]).forEach(function(e){i+=e.duration});(e.preloadHints||[]).forEach(function(e){if(e.type==="PART"){i+=t.partTargetDuration}});return i};const Fh=e=>(e.segments||[]).reduce((i,s,n)=>{if(s.parts){s.parts.forEach(function(e,t){i.push({duration:e.duration,segmentIndex:n,partIndex:t,part:e,segment:s})})}else{i.push({duration:s.duration,segmentIndex:n,partIndex:null,segment:s,part:null})}return i},[]);const qh=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]};const jh=({preloadSegment:e})=>{if(!e){return}const{parts:t,preloadHints:i}=e;let s=(i||[]).reduce((e,t)=>e+(t.type==="PART"?1:0),0);s+=t&&t.length?t.length:0;return s};const Vh=(e,t)=>{if(t.endList){return 0}if(e&&e.suggestedPresentationDelay){return e.suggestedPresentationDelay}const i=qh(t).length>0;if(i&&t.serverControl&&t.serverControl.partHoldBack){return t.serverControl.partHoldBack}else if(i&&t.partTargetDuration){return t.partTargetDuration*3}else if(t.serverControl&&t.serverControl.holdBack){return t.serverControl.holdBack}else if(t.targetDuration){return t.targetDuration*3}return 0};const $h=function(e,t){let i=0;let s=t-e.mediaSequence;let n=e.segments[s];if(n){if(typeof n.start!=="undefined"){return{result:n.start,precise:true}}if(typeof n.end!=="undefined"){return{result:n.end-n.duration,precise:true}}}while(s--){n=e.segments[s];if(typeof n.end!=="undefined"){return{result:i+n.end,precise:true}}i+=Bh(e,n);if(typeof n.start!=="undefined"){return{result:i+n.start,precise:true}}}return{result:i,precise:false}};const Hh=function(e,t){let i=0;let s;let n=t-e.mediaSequence;for(;n<e.segments.length;n++){s=e.segments[n];if(typeof s.start!=="undefined"){return{result:s.start-i,precise:true}}i+=Bh(e,s);if(typeof s.end!=="undefined"){return{result:s.end-i,precise:true}}}return{result:-1,precise:false}};const Gh=function(e,t,i){if(typeof t==="undefined"){t=e.mediaSequence+e.segments.length}if(t<e.mediaSequence){return 0}const s=$h(e,t);if(s.precise){return s.result}const n=Hh(e,t);if(n.precise){return n.result}return s.result+i};const zh=function(e,t,i){if(!e){return 0}if(typeof i!=="number"){i=0}if(typeof t==="undefined"){if(e.totalDuration){return e.totalDuration}if(!e.endList){return Ly.Infinity}}return Gh(e,t,i)};const Wh=function({defaultDuration:t,durationList:i,startIndex:s,endIndex:n}){let r=0;if(s>n){[s,n]=[n,s]}if(s<0){for(let e=s;e<Math.min(0,n);e++){r+=t}s=0}for(let e=s;e<n;e++){r+=i[e].duration}return r};const Yh=function(e,t,i,s){if(!e||!e.segments){return null}if(e.endList){return zh(e)}if(t===null){return null}t=t||0;let n=Gh(e,e.mediaSequence+e.segments.length,t);if(i){s=typeof s==="number"?s:Vh(null,e);n-=s}return Math.max(0,n)};const Xh=function(e,t,i){const s=true;const n=t||0;let r=Yh(e,t,s,i);if(r===null){return R()}if(r<n){r=n}return R(n,r)};const Kh=function({playlist:t,currentTime:i,startingSegmentIndex:s,startingPartIndex:n,startTime:r,exactManifestTimings:a}){let o=i-r;const l=Fh(t);let c=0;for(let e=0;e<l.length;e++){const u=l[e];if(s!==u.segmentIndex){continue}if(typeof n==="number"&&typeof u.partIndex==="number"&&n!==u.partIndex){continue}c=e;break}if(o<0){if(c>0){for(let e=c-1;e>=0;e--){const u=l[e];o+=u.duration;if(a){if(o<0){continue}}else if(o+Ih<=0){continue}return{partIndex:u.partIndex,segmentIndex:u.segmentIndex,startTime:r-Wh({defaultDuration:t.targetDuration,durationList:l,startIndex:c,endIndex:e})}}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(c<0){for(let e=c;e<0;e++){o-=t.targetDuration;if(o<0){return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}}c=0}for(let e=c;e<l.length;e++){const u=l[e];o-=u.duration;const d=u.duration>Ih;const h=o===0;const f=d&&o+Ih>=0;if(h||f){if(e!==l.length-1){continue}}if(a){if(o>0){continue}}else if(o-Ih>=0){continue}return{partIndex:u.partIndex,segmentIndex:u.segmentIndex,startTime:r+Wh({defaultDuration:t.targetDuration,durationList:l,startIndex:c,endIndex:e})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}};const Qh=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()};const Jh=function(e){return e.excludeUntil&&e.excludeUntil===Infinity};const Zh=function(e){const t=Qh(e);return!e.disabled&&!t};const ef=function(e){return e.disabled};const tf=function(t){for(let e=0;e<t.segments.length;e++){if(t.segments[e].key){return true}}return false};const sf=function(e,t){return t.attributes&&t.attributes[e]};const nf=function(e,t,i,s=0){if(!sf("BANDWIDTH",i)){return NaN}const n=e*i.attributes.BANDWIDTH;return(n-s*8)/t};const rf=(e,t)=>{if(e.playlists.length===1){return true}const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(e=>{if(!Zh(e)){return false}return(e.attributes.BANDWIDTH||0)<i}).length===0};const af=(e,t)=>{if(!e&&!t||!e&&t||e&&!t){return false}if(e===t){return true}if(e.id&&t.id&&e.id===t.id){return true}if(e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri){return true}if(e.uri&&t.uri&&e.uri===t.uri){return true}return false};const of=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=false;for(const n in i){for(const r in i[n]){s=t(i[n][r]);if(s){break}}if(s){break}}return!!s};const lf=t=>{if(!t||!t.playlists||!t.playlists.length){const i=of(t,e=>e.playlists&&e.playlists.length||e.uri);return i}for(let e=0;e<t.playlists.length;e++){const s=t.playlists[e];const n=s.attributes&&s.attributes.CODECS;if(n&&n.split(",").every(e=>yo(e))){continue}const i=of(t,e=>af(s,e));if(i){continue}return false}return true};var cf={liveEdgeDelay:Vh,duration:zh,seekable:Xh,getMediaInfoForTime:Kh,isEnabled:Zh,isDisabled:ef,isExcluded:Qh,isIncompatible:Jh,playlistEnd:Yh,isAes:tf,hasAttribute:sf,estimateSegmentRequestTime:nf,isLowestEnabledRendition:rf,isAudioOnly:lf,playlistMatch:af,segmentDurationWithParts:Bh};const{log:uf}=C;const df=(e,t)=>{return`${e}-${t}`};const hf=(e,t,i)=>{return`placeholder-uri-${e}-${t}-${i}`};const ff=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const a=new co;if(t){a.on("warn",t)}if(e){a.on("info",e)}s.forEach(e=>a.addParser(e));n.forEach(e=>a.addTagMapper(e));a.push(i);a.end();const o=a.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){if(o.hasOwnProperty(e)){delete o[e]}});if(o.segments){o.segments.forEach(function(t){["parts","preloadHints"].forEach(function(e){if(t.hasOwnProperty(e)){delete t[e]}})})}}if(!o.targetDuration){let e=10;if(o.segments&&o.segments.length){e=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)}if(t){t({message:`manifest has no targetDuration defaulting to ${e}`})}o.targetDuration=e}const l=qh(o);if(l.length&&!o.partTargetDuration){const c=l.reduce((e,t)=>Math.max(e,t.duration),0);if(t){t({message:`manifest has no partTargetDuration defaulting to ${c}`});uf.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")}o.partTargetDuration=c}return o};const pf=(n,r)=>{if(!n.mediaGroups){return}["AUDIO","SUBTITLES"].forEach(e=>{if(!n.mediaGroups[e]){return}for(const t in n.mediaGroups[e]){for(const i in n.mediaGroups[e][t]){const s=n.mediaGroups[e][t][i];r(s,e,t,i)}}})};const mf=({playlist:e,uri:t,id:i})=>{e.id=i;e.playlistErrors_=0;if(t){e.uri=t}e.attributes=e.attributes||{}};const gf=e=>{let t=e.playlists.length;while(t--){const i=e.playlists[t];mf({playlist:i,id:df(t,i.uri)});i.resolvedUri=Th(e.uri,i.uri);e.playlists[i.id]=i;e.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){uf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const yf=t=>{pf(t,e=>{if(e.uri){e.resolvedUri=Th(t.uri,e.uri)}})};const _f=(e,t)=>{const i=df(0,t);const s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Ly.location.href,resolvedUri:Ly.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};s.playlists[i]=s.playlists[0];s.playlists[t]=s.playlists[0];return s};const vf=(o,e,l=hf)=>{o.uri=e;for(let e=0;e<o.playlists.length;e++){if(!o.playlists[e].uri){const t=`placeholder-uri-${e}`;o.playlists[e].uri=t}}const i=lf(o);pf(o,(e,n,r,a)=>{if(!e.playlists||!e.playlists.length){if(i&&n==="AUDIO"&&!e.uri){for(let e=0;e<o.playlists.length;e++){const t=o.playlists[e];if(t.attributes&&t.attributes.AUDIO&&t.attributes.AUDIO===r){return}}}e.playlists=[y({},e)]}e.playlists.forEach(function(e,t){const i=l(n,r,a,e);const s=df(t,i);if(e.uri){e.resolvedUri=e.resolvedUri||Th(o.uri,e.uri)}else{e.uri=t===0?i:s;e.resolvedUri=e.uri}e.id=e.id||s;e.attributes=e.attributes||{};o.playlists[e.id]=e;o.playlists[e.uri]=e})});gf(o);yf(o)};class bf{constructor(){this.offset_=null;this.pendingDateRanges_=new Map;this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null){return}if(!e.length){return}const[t]=e;if(t.programDateTime===undefined){return}this.offset_=t.programDateTime/1e3}setPendingDateRanges(e=[]){if(!e.length){return}const[t]=e;const i=t.startDate.getTime();this.trimProcessedDateRanges_(i);this.pendingDateRanges_=e.reduce((e,t)=>{e.set(t.id,t);return e},new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id);this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null){return[]}const s={};const n=[];this.pendingDateRanges_.forEach((e,t)=>{if(this.processedDateRanges_.has(t)){return}e.startTime=e.startDate.getTime()/1e3-this.offset_;e.processDateRange=()=>this.processDateRange(e);n.push(e);if(!e.class){return}if(s[e.class]){const i=s[e.class].push(e);e.classListIndex=i-1}else{s[e.class]=[e];e.classListIndex=0}});for(const e of n){const t=s[e.class]||[];if(e.endDate){e.endTime=e.endDate.getTime()/1e3-this.offset_}else if(e.endOnNext&&t[e.classListIndex+1]){e.endTime=t[e.classListIndex+1].startTime}else if(e.duration){e.endTime=e.startTime+e.duration}else if(e.plannedDuration){e.endTime=e.startTime+e.plannedDuration}else{e.endTime=e.startTime}}return n}trimProcessedDateRanges_(i){const e=new Map(this.processedDateRanges_);e.forEach((e,t)=>{if(e.startDate.getTime()<i){this.processedDateRanges_.delete(t)}})}}const Tf=22;const Sf=({requestType:e,request:t,error:i,parseFailure:s})=>{const n=t.status<200||t.status>299;const r=t.status>=400&&t.status<=499;const a={uri:t.uri,requestType:e};const o=n&&!r||s;if(i&&r){a.error=y({},i);a.errorType=C.Error.NetworkRequestFailed}else if(t.aborted){a.errorType=C.Error.NetworkRequestAborted}else if(t.timedout){a.erroType=C.Error.NetworkRequestTimeout}else if(o){const l=s?C.Error.NetworkBodyParserFailed:C.Error.NetworkBadStatus;a.errorType=l;a.status=t.status;a.headers=t.headers}return a};const{EventTarget:Ef}=C;const wf=(e,t)=>{if(t.endList||!t.serverControl){return e}const i={};if(t.serverControl.canBlockReload){const{preloadSegment:s}=t;let e=t.mediaSequence+t.segments.length;if(s){const n=s.parts||[];const r=jh(t)-1;if(r>-1&&r!==n.length-1){i._HLS_part=r}if(r>-1||n.length){e--}}i._HLS_msn=e}if(t.serverControl&&t.serverControl.canSkipUntil){i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(i).length){const a=new Ly.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){if(!i.hasOwnProperty(e)){return}a.searchParams.set(e,i[e])});e=a.toString()}return e};const If=(t,i)=>{if(!t){return i}const s=M(t,i);if(t.preloadHints&&!i.preloadHints){delete s.preloadHints}if(t.parts&&!i.parts){delete s.parts}else if(t.parts&&i.parts){for(let e=0;e<i.parts.length;e++){if(t.parts&&t.parts[e]){s.parts[e]=M(t.parts[e],i.parts[e])}}}if(!t.skipped&&i.skipped){s.skipped=false}if(t.preload&&!i.preload){s.preload=false}return s};const Cf=(e,t,i)=>{const s=e.slice();const n=t.slice();i=i||0;const r=[];let a;for(let e=0;e<n.length;e++){const o=s[e+i];const l=n[e];if(o){a=o.map||a;r.push(If(o,l))}else{if(a&&!l.map){l.map=a}r.push(l)}}return r};const kf=(e,t)=>{if(!e.resolvedUri&&e.uri){e.resolvedUri=Th(t,e.uri)}if(e.key&&!e.key.resolvedUri){e.key.resolvedUri=Th(t,e.key.uri)}if(e.map&&!e.map.resolvedUri){e.map.resolvedUri=Th(t,e.map.uri)}if(e.map&&e.map.key&&!e.map.key.resolvedUri){e.map.key.resolvedUri=Th(t,e.map.key.uri)}if(e.parts&&e.parts.length){e.parts.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=Th(t,e.uri)})}if(e.preloadHints&&e.preloadHints.length){e.preloadHints.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=Th(t,e.uri)})}};const Af=function(e){const t=e.segments||[];const i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;e<i.preloadHints.length;e++){if(i.preloadHints[e].type==="MAP"){return t}}}i.duration=e.targetDuration;i.preload=true;t.push(i)}return t};const Df=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment;const xf=(e,n,t=Df)=>{const i=M(e,{});const s=i.playlists[n.id];if(!s){return null}if(t(s,n)){return null}n.segments=Af(n);const r=M(s,n);if(r.preloadSegment&&!n.preloadSegment){delete r.preloadSegment}if(s.segments){if(n.skip){n.segments=n.segments||[];for(let e=0;e<n.skip.skippedSegments;e++){n.segments.unshift({skipped:true})}}r.segments=Cf(s.segments,n.segments,n.mediaSequence-s.mediaSequence)}r.segments.forEach(e=>{kf(e,r.resolvedUri)});for(let e=0;e<i.playlists.length;e++){if(i.playlists[e].id===n.id){i.playlists[e]=r}}i.playlists[n.id]=r;i.playlists[n.uri]=r;pf(e,(t,e,i,s)=>{if(!t.playlists){return}for(let e=0;e<t.playlists.length;e++){if(n.id===t.playlists[e].id){t.playlists[e]=r}}});return i};const Of=(e,t)=>{const i=e.segments||[];const s=i[i.length-1];const n=s&&s.parts&&s.parts[s.parts.length-1];const r=n&&n.duration||s&&s.duration;if(t&&r){return r*1e3}return(e.partTargetDuration||e.targetDuration||10)*500};const Pf=(e,t,i)=>{if(!e){return}const n=[];e.forEach(e=>{if(!e.attributes){return}const{BANDWIDTH:t,RESOLUTION:i,CODECS:s}=e.attributes;n.push({id:e.id,bandwidth:t,resolution:i,codecs:s})});return{type:t,isLive:i,renditions:n}};class Rf extends Ef{constructor(e,t,i={}){super();if(!e){throw new Error("A non-empty playlist URL or object is required")}this.logger_=Eh("PlaylistLoader");const{withCredentials:s=false}=i;this.src=e;this.vhs_=t;this.withCredentials=s;this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[];this.customTagMappers=n&&n.customTagMappers||[];this.llhls=n&&n.llhls;this.dateRangesStorage_=new bf;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e){return}this.dateRangesStorage_.setOffset(e.segments);this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();if(!t.length||!this.addDateRangesToTextTrack_){return}this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const e=this.media();let t=Th(this.main.uri,e.uri);if(this.llhls){t=wf(t,e)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(!this.request){return}if(e){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Sf({requestType:e.requestType,request:e,error:e.error})};this.trigger("error")}parseManifest_({url:t,manifestString:e}){try{return ff({onwarn:({message:e})=>this.logger_(`m3u8-parser warn for ${t}: ${e}`),oninfo:({message:e})=>this.logger_(`m3u8-parser info for ${t}: ${e}`),manifestString:e,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(e){this.error=e;this.error.metadata={errorType:C.Error.StreamingHlsPlaylistParserError,error:e}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null;this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const r=t||this.parseManifest_({url:i,manifestString:e});r.lastRequest=Date.now();mf({playlist:r,uri:i,id:s});const a=xf(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration;this.pendingMedia_=null;if(a){this.main=a;this.media_=this.main.playlists[s]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(Of(this.media(),!!a));n.parsedPlaylist=Pf(this.main.playlists,n.playlistInfo.type,!this.media_.endList);this.trigger({type:"playlistparsecomplete",metadata:n});this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();Ly.clearTimeout(this.mediaUpdateTimeout);Ly.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new bf;this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(i,e){if(!i){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof i==="string"){if(!this.main.playlists[i]){throw new Error("Unknown playlist URI: "+i)}i=this.main.playlists[i]}Ly.clearTimeout(this.finalRenditionTimeout);if(e){const a=(i.partTargetDuration||i.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=Ly.setTimeout(this.media.bind(this,i,false),a);return}const s=this.state;const t=!this.media_||i.id!==this.media_.id;const n=this.main.playlists[i.id];if(n&&n.endList||i.endList&&i.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=i;if(t){this.trigger("mediachanging");if(s==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(Of(i,true));if(!t){return}this.state="SWITCHING_MEDIA";if(this.request){if(i.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=i;const r={playlistInfo:{type:"media",uri:i.uri}};this.trigger({type:"playlistrequeststart",metadata:r});this.request=this.vhs_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(!this.request){return}i.lastRequest=Date.now();i.resolvedUri=Sh(i.resolvedUri,t);if(e){return this.playlistRequestError(this.request,i,s)}this.trigger({type:"playlistrequestcomplete",metadata:r});this.haveMetadata({playlistString:t.responseText,url:i.uri,id:i.id});if(s==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}})}pause(){if(this.mediaUpdateTimeout){Ly.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}this.stopRequest();if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MAIN_MANIFEST"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}load(e){if(this.mediaUpdateTimeout){Ly.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=Ly.setTimeout(()=>{this.mediaUpdateTimeout=null;this.load()},i);return}if(!this.started){this.start();return}if(t&&!t.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(e){if(this.mediaUpdateTimeout){Ly.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=Ly.setTimeout(()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(e)},e)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=Ly.location.href}this.src.resolvedUri=this.src.uri;setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const s={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:s});this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(!this.request){return}this.request=null;if(e){this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2,metadata:Sf({requestType:t.requestType,request:t,error:e})};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.trigger({type:"playlistrequestcomplete",metadata:s});this.src=Sh(this.src,t);this.trigger({type:"playlistparsestart",metadata:s});const i=this.parseManifest_({manifestString:t.responseText,url:this.src});s.parsedPlaylist=Pf(i.playlists,s.playlistInfo.type,false);this.trigger({type:"playlistparsecomplete",metadata:s});this.setupInitialPlaylist(i)})}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(e){this.state="HAVE_MAIN_MANIFEST";if(e.playlists){this.main=e;vf(this.main,this.srcUri());e.playlists.forEach(t=>{t.segments=Af(t);t.segments.forEach(e=>{kf(e,t.resolvedUri)})});this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const t=this.srcUri()||Ly.location.href;this.main=_f(e,t);this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main;const s=e.ID;let n=i.playlists.length;while(n--){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const a=r.resolvedUri;const o=r.id;if(t){const l=this.createCloneURI_(r.resolvedUri,e);const c=df(s,l);const u=this.createCloneAttributes_(s,r.attributes);const d=this.createClonePlaylist_(r,c,e,u);i.playlists[n]=d;i.playlists[c]=d;i.playlists[l]=d}else{i.playlists.splice(n,1)}delete i.playlists[o];delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const r=this.main;const n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(!r.mediaGroups[e]||!r.mediaGroups[e][n]){return}for(const t in r.mediaGroups[e]){if(t===n){for(const i in r.mediaGroups[e][t]){const s=r.mediaGroups[e][t][i];s.playlists.forEach((e,t)=>{const i=r.playlists[e.id];const s=i.id;const n=i.resolvedUri;delete r.playlists[s];delete r.playlists[n]})}delete r.mediaGroups[e][t]}}});if(t){this.createClonedMediaGroups_(e)}}addClonePathway(e,t={}){const i=this.main;const s=i.playlists.length;const n=this.createCloneURI_(t.resolvedUri,e);const r=df(e.ID,n);const a=this.createCloneAttributes_(e.ID,t.attributes);const o=this.createClonePlaylist_(t,r,e,a);i.playlists[s]=o;i.playlists[r]=o;i.playlists[n]=o;this.createClonedMediaGroups_(e)}createClonedMediaGroups_(u){const d=u.ID;const s=u["BASE-ID"];const h=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(o=>{if(!h.mediaGroups[o]||h.mediaGroups[o][d]){return}for(const e in h.mediaGroups[o]){if(e===s){h.mediaGroups[o][d]={}}else{continue}for(const l in h.mediaGroups[o][e]){const t=h.mediaGroups[o][e][l];h.mediaGroups[o][d][l]=y({},t);const c=h.mediaGroups[o][d][l];const i=this.createCloneURI_(t.resolvedUri,u);c.resolvedUri=i;c.uri=i;c.playlists=[];t.playlists.forEach((e,t)=>{const i=h.playlists[e.id];const s=hf(o,d,l);const n=df(d,s);if(i&&!h.playlists[n]){const r=this.createClonePlaylist_(i,n,u);const a=r.resolvedUri;h.playlists[n]=r;h.playlists[a]=r}c.playlists[t]=this.createClonePlaylist_(e,n,u)})}}})}createClonePlaylist_(e,t,i,s){const n=this.createCloneURI_(e.resolvedUri,i);const r={resolvedUri:n,uri:n,id:t};if(e.segments){r.segments=[]}if(s){r.attributes=s}return M(e,r)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const s=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(s)){i.searchParams.set(n,s[n])}return i.href}createCloneAttributes_(t,i){const s={["PATHWAY-ID"]:t};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i[e]){s[e]=t}});return s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes.keyId;if(s){t.add(s.toLowerCase())}}return t}}}const Lf=function(e,t,i,s){const n=e.responseType==="arraybuffer"?e.response:e.responseText;if(!t&&n){e.responseTime=Date.now();e.roundTripTime=e.responseTime-e.requestTime;e.bytesReceived=n.byteLength||n.length;if(!e.bandwidth){e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)}}if(i.headers){e.responseHeaders=i.headers}if(t&&t.code==="ETIMEDOUT"){e.timedout=true}if(!t&&!e.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))}s(t,e)};const Nf=(e,t)=>{if(!e||!e.size){return}let i=t;e.forEach(e=>{i=e(i)});return i};const Mf=(e,t,i,s)=>{if(!e||!e.size){return}e.forEach(e=>{e(t,i,s)})};const Uf=function(){const e=function e(t,i){t=M({timeout:45e3},t);const s=e.beforeRequest||C.Vhs.xhr.beforeRequest;const n=e._requestCallbackSet||C.Vhs.xhr._requestCallbackSet||new Set;const r=e._responseCallbackSet||C.Vhs.xhr._responseCallbackSet;if(s&&typeof s==="function"){C.log.warn("beforeRequest is deprecated, use onRequest instead.");n.add(s)}const a=C.Vhs.xhr.original===true?C.xhr:C.Vhs.xhr;const o=Nf(n,t);n.delete(s);const l=a(o||t,function(e,t){Mf(r,l,e,t);return Lf(l,e,t,i)});const c=l.abort;l.abort=function(){l.aborted=true;return c.apply(l,arguments)};l.uri=t.uri;l.requestType=t.requestType;l.requestTime=Date.now();return l};e.original=true;return e};const Bf=function(e){let t;const i=e.offset;if(typeof e.offset==="bigint"||typeof e.length==="bigint"){t=Ly.BigInt(e.offset)+Ly.BigInt(e.length)-Ly.BigInt(1)}else{t=e.offset+e.length-1}return"bytes="+i+"-"+t};const Ff=function(e){const t={};if(e.byterange){t.Range=Bf(e.byterange)}return t};const qf=function(e,t){return e.start(t)+"-"+e.end(t)};const jf=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")};const Vf=function(e){if(e>=32&&e<126){return String.fromCharCode(e)}return"."};const $f=function(i){const s={};Object.keys(i).forEach(e=>{const t=i[e];if(Do(t)){s[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}else{s[e]=t}});return s};const Hf=function(e){const t=e.byterange||{length:Infinity,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")};const Gf=function(e){return e.resolvedUri};const zf=e=>{const t=Array.prototype.slice.call(e);const i=16;let s="";let n;let r;for(let e=0;e<t.length/i;e++){n=t.slice(e*i,e*i+i).map(jf).join("");r=t.slice(e*i,e*i+i).map(Vf).join("");s+=n+" "+r+"\n"}return s};const Wf=({bytes:e})=>zf(e);const Yf=e=>{let t="";let i;for(i=0;i<e.length;i++){t+=qf(e,i)+" "}return t};var Xf=Object.freeze({__proto__:null,createTransferableMessage:$f,initSegmentId:Hf,segmentKeyId:Gf,hexDump:zf,tagDump:Wf,textRanges:Yf});const Kf=.25;const Qf=(e,t)=>{if(!t.dateTimeObject){return null}const i=t.videoTimingInfo.transmuxerPrependedSeconds;const s=t.videoTimingInfo.transmuxedPresentationStart;const n=s+i;const r=e-n;return new Date(t.dateTimeObject.getTime()+r*1e3)};const Jf=e=>{return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds};const Zf=(e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||t.segments.length===0){return null}let s=t.segments[0];if(i<new Date(s.dateTimeObject)){return null}for(let e=0;e<t.segments.length-1;e++){s=t.segments[e];const l=new Date(t.segments[e+1].dateTimeObject);if(i<l){break}}const n=t.segments[t.segments.length-1];const r=n.dateTimeObject;const a=n.videoTimingInfo?Jf(n.videoTimingInfo):n.duration+n.duration*Kf;const o=new Date(r.getTime()+a*1e3);if(i>o){return null}if(i>new Date(r)){s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:cf.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}};const ep=(t,i)=>{if(!i||!i.segments||i.segments.length===0){return null}let s=0;let n;for(let e=0;e<i.segments.length;e++){n=i.segments[e];s=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:s+n.duration;if(t<=s){break}}const e=i.segments[i.segments.length-1];if(e.videoTimingInfo&&e.videoTimingInfo.transmuxedPresentationEnd<t){return null}if(t>s){if(t>s+e.duration*Kf){return null}n=e}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:s-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}};const tp=(e,t)=>{let i;let s;try{i=new Date(e);s=new Date(t)}catch(e){}const n=i.getTime();const r=s.getTime();return(r-n)/1e3};const ip=t=>{if(!t.segments||t.segments.length===0){return false}for(let e=0;e<t.segments.length;e++){const i=t.segments[e];if(!i.dateTimeObject){return false}}return true};const sp=({playlist:e,time:t=undefined,callback:i})=>{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!e||t===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const s=ep(t,e);if(!s){return i({message:"valid programTime was not found"})}if(s.type==="estimate"){return i({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:s.estimatedStart})}const n={mediaSeconds:t};const r=Qf(t,s.segment);if(r){n.programDateTime=r.toISOString()}return i(null,n)};const np=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:n=true,tech:r,callback:a})=>{if(!a){throw new Error("seekToProgramTime: callback must be provided")}if(typeof e==="undefined"||!t||!s){return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!t.endList&&!r.hasStarted_){return a({message:"player must be playing a live stream to start buffering"})}if(!ip(t)){return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri})}const o=Zf(e,t);if(!o){return a({message:`${e} was not found in the stream`})}const l=o.segment;const c=tp(l.dateTimeObject,e);if(o.type==="estimate"){if(i===0){return a({message:`${e} is not buffered yet. Try again`})}s(o.estimatedStart+c);r.one("seeked",()=>{np({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:a})});return}const u=l.start+c;const d=()=>{return a(null,r.currentTime())};r.one("seeked",d);if(n){r.pause()}s(u)};const rp=(e,t)=>{if(e.readyState===4){return t()}return};const ap=(e,t,n,r)=>{let a=[];let o;let l=false;const c=function(e,t,i,s){t.abort();l=true;return n(e,t,i,s)};const s=function(e,t){if(l){return}if(e){e.metadata=Sf({requestType:r,request:t,error:e});return c(e,t,"",a)}const i=t.responseText.substring(a&&a.byteLength||0,t.responseText.length);a=No(a,Lo(i,true));o=o||jd(a);if(a.length<10||o&&a.length<o+2){return rp(t,()=>c(e,t,"",a))}const s=ch(a);if(s==="ts"&&a.length<188){return rp(t,()=>c(e,t,"",a))}if(!s&&a.length<376){return rp(t,()=>c(e,t,"",a))}return c(null,t,s,a)};const i={uri:e,beforeSend(i){i.overrideMimeType("text/plain; charset=x-user-defined");i.addEventListener("progress",function({total:e,loaded:t}){return Lf(i,null,{statusCode:i.status},s)})}};const u=t(i,function(e,t){return Lf(u,e,t,s)});return u};const{EventTarget:op}=C;const lp=function(t,i){if(!Df(t,i)){return false}if(t.sidx&&i.sidx&&(t.sidx.offset!==i.sidx.offset||t.sidx.length!==i.sidx.length)){return false}else if(!t.sidx&&i.sidx||t.sidx&&!i.sidx){return false}if(t.segments&&!i.segments||!t.segments&&i.segments){return false}if(!t.segments&&!i.segments){return true}for(let e=0;e<t.segments.length;e++){const s=t.segments[e];const n=i.segments[e];if(s.uri!==n.uri){return false}if(!s.byterange&&!n.byterange){continue}const r=s.byterange;const a=n.byterange;if(r&&!a||!r&&a){return false}if(r.offset!==a.offset||r.length!==a.length){return false}}return true};const cp=(e,t,i,s)=>{const n=s.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${n}`};const up=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=Od(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:n});vf(r,t,cp);return r};const dp=(n,r)=>{pf(n,(e,t,i,s)=>{if(!(s in r.mediaGroups[t][i])){delete n.mediaGroups[t][i][s]}})};const hp=(e,t,i)=>{let a=true;let o=M(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const s=t.playlists[e];if(s.sidx){const r=Fu(s.sidx);if(i&&i[r]&&i[r].sidx){xu(s,i[r].sidx,s.sidx.resolvedUri)}}const n=xf(o,s,lp);if(n){o=n;a=false}}pf(t,(t,i,s,n)=>{if(t.playlists&&t.playlists.length){const r=t.playlists[0].id;const e=xf(o,t.playlists[0],lp);if(e){o=e;if(!(n in o.mediaGroups[i][s])){o.mediaGroups[i][s][n]=t}o.mediaGroups[i][s][n].playlists[0]=o.playlists[r];a=false}}});dp(o,t);if(t.minimumUpdatePeriod!==e.minimumUpdatePeriod){a=false}if(a){return null}return o};const fp=(e,t)=>{const i=Boolean(!e.map&&!t.map);const s=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return s&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length};const pp=(e,t)=>{const i={};for(const s in e){const n=e[s];const r=n.sidx;if(r){const a=Fu(r);if(!t[a]){break}const o=t[a].sidxInfo;if(fp(o,r)){i[a]=t[a]}}}return i};const mp=(e,r)=>{const t=pp(e.playlists,r);let a=t;pf(e,(e,t,i,s)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;a=M(a,pp(n,r))}});return a};class gp extends op{constructor(e,t,i={},s){super();this.mainPlaylistLoader_=s||this;if(!s){this.isMain_=true}const{withCredentials:n=false}=i;this.vhs_=t;this.withCredentials=n;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!e){throw new Error("A non-empty playlist URL or object is required")}this.on("minimumUpdatePeriod",()=>{this.refreshXml_()});this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)});this.state="HAVE_NOTHING";this.loadedPlaylists_={};this.logger_=Eh("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=e;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=e}}requestErrored_(e,t,i){if(!this.request){return true}this.request=null;if(e){this.error=typeof e==="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(o,r,a){const l=o.sidx&&Fu(o.sidx);if(!o.sidx||!l||this.mainPlaylistLoader_.sidxMapping_[l]){this.mediaRequest_=Ly.setTimeout(()=>a(false),0);return}const c=Sh(o.sidx.resolvedUri);const u=(e,t)=>{if(this.requestErrored_(e,t,r)){return}const i=this.mainPlaylistLoader_.sidxMapping_;const{requestType:s}=t;let n;try{n=Bd(w(t.response).subarray(8))}catch(e){e.metadata=Sf({requestType:s,request:t,parseFailure:true});this.requestErrored_(e,t,r);return}i[l]={sidxInfo:o.sidx,sidx:n};xu(o,n,o.sidx.resolvedUri);return a(true)};const e="dash-sidx";this.request=ap(c,this.vhs_.xhr,(e,t,i,s)=>{if(e){return u(e,t)}if(!i||i!=="mp4"){const a=i||"unknown";return u({status:t.status,message:`Unsupported ${a} container type for sidx segment at URL: ${c}`,response:"",playlist:o,internal:true,playlistExclusionDuration:Infinity,code:2},t)}const{offset:n,length:r}=o.sidx.byterange;if(s.length>=r+n){return u(e,{response:s.subarray(n,n+r),status:t.status,uri:t.uri})}this.request=this.vhs_.xhr({uri:c,responseType:"arraybuffer",requestType:"dash-sidx",headers:Ff({byterange:o.sidx.byterange})},u)},e)}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};Ly.clearTimeout(this.minimumUpdatePeriodTimeout_);Ly.clearTimeout(this.mediaRequest_);Ly.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.mediaRequest_=null;this.minimumUpdatePeriodTimeout_=null;if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(t){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}const i=this.state;if(typeof t==="string"){if(!this.mainPlaylistLoader_.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.mainPlaylistLoader_.main.playlists[t]}const e=!this.media_||t.id!==this.media_.id;if(e&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList){this.state="HAVE_METADATA";this.media_=t;if(e){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!e){return}if(this.media_){this.trigger("mediachanging")}this.addSidxSegments_(t,i,e=>{this.haveMetadata({startingState:i,playlist:t})})}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA";this.loadedPlaylists_[t.id]=t;this.mediaRequest_=null;this.refreshMedia_(t.id);if(e==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}pause(){if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.stopRequest();Ly.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){Ly.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(e){Ly.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=Ly.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}if(t&&!t.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_){this.trigger("minimumUpdatePeriod");this.updateMinimumUpdatePeriodTimeout_()}this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}start(){this.started=true;if(!this.isMain_){this.mediaRequest_=Ly.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}})}requestMain_(n){const r={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:r});this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(e,t)=>{if(e){const{requestType:s}=t;e.metadata=Sf({requestType:s,request:t,error:e})}if(this.requestErrored_(e,t)){if(this.state==="HAVE_NOTHING"){this.started=false}return}this.trigger({type:"manifestrequestcomplete",metadata:r});const i=t.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=t.responseText;if(t.responseHeaders&&t.responseHeaders.date){this.mainLoaded_=Date.parse(t.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=Sh(this.mainPlaylistLoader_.srcUrl,t);if(i){this.handleMain_();this.syncClientServerClock_(()=>{return n(t,i)});return}return n(t,i)})}syncClientServerClock_(n){const r=Pd(this.mainPlaylistLoader_.mainXml_);if(r===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return n()}if(r.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=r.value-Date.now();return n()}this.request=this.vhs_.xhr({uri:Th(this.mainPlaylistLoader_.srcUrl,r.value),method:r.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(e,t)=>{if(!this.request){return}if(e){const{requestType:s}=t;this.error.metadata=Sf({requestType:s,request:t,error:e});this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return n()}let i;if(r.method==="HEAD"){if(!t.responseHeaders||!t.responseHeaders.date){i=this.mainLoaded_}else{i=Date.parse(t.responseHeaders.date)}}else{i=Date.parse(t.responseText)}this.mainPlaylistLoader_.clientOffset_=i-Date.now();n()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST";if(this.isMain_){this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=up({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e;this.error.metadata={errorType:C.Error.StreamingDashManifestParserError,error:e};this.trigger("error")}if(e){i=hp(e,i,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=i?i:e;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=s}if(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(i);if(i){const{duration:e,endList:n}=i;const r=[];i.playlists.forEach(e=>{r.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})});const a={duration:e,isLive:!n,renditions:r};t.parsedManifest=a;this.trigger({type:"manifestparsecomplete",metadata:t})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;if(e.createMupOnMedia_){e.off("loadedmetadata",e.createMupOnMedia_);e.createMupOnMedia_=null}if(e.minimumUpdatePeriodTimeout_){Ly.clearTimeout(e.minimumUpdatePeriodTimeout_);e.minimumUpdatePeriodTimeout_=null}let t=e.main&&e.main.minimumUpdatePeriod;if(t===0){if(e.media()){t=e.media().targetDuration*1e3}else{e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_;e.one("loadedmetadata",e.createMupOnMedia_)}}if(typeof t!=="number"||t<=0){if(t<0){this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`)}return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=Ly.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null;t.trigger("minimumUpdatePeriod");t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{if(!t){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=mp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)})})}refreshMedia_(e){if(!e){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const t=this.mainPlaylistLoader_.main.playlists;const i=!this.media_||this.media_!==t[e];if(i){this.media_=t[e]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const s=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=Ly.setTimeout(()=>{this.trigger("mediaupdatetimeout");s()},Of(this.media(),Boolean(i)))};s()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(e=>{return{cueTime:e.start,frames:[{data:e.messageData}]}});this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes["cenc:default_KID"];if(s){t.add(s.replace(/-/g,"").toLowerCase())}}return t}}}var L={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const yp=t=>{const i=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++){i[e]=t.charCodeAt(e)}return i.buffer};const _p=function(e){e.on=e.addEventListener;e.off=e.removeEventListener;return e};const vp=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(e){const i=new BlobBuilder;i.append(t);return URL.createObjectURL(i.getBlob())}};const bp=function(s){return function(){const e=vp(s);const t=_p(new Worker(e));t.objURL=e;const i=t.terminate;t.on=t.addEventListener;t.off=t.removeEventListener;t.terminate=function(){URL.revokeObjectURL(e);return i.call(this)};return t}};const Tp=function(e){return`var browserWorkerPolyFill = ${_p.toString()};\n`+"browserWorkerPolyFill(self);\n"+e};const Sp=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)};const Ep=Tp(Sp(function(){var M=typeof globalThis!=="undefined"?globalThis:typeof Ly!=="undefined"?Ly:typeof Ry!=="undefined"?Ry:typeof self!=="undefined"?self:{};var e=function(){this.init=function(){var r={};this.on=function(e,t){if(!r[e]){r[e]=[]}r[e]=r[e].concat(t)};this.off=function(e,t){var i;if(!r[e]){return false}i=r[e].indexOf(t);r[e]=r[e].slice();r[e].splice(i,1);return i>-1};this.trigger=function(e){var t,i,s,n;t=r[e];if(!t){return}if(arguments.length===2){s=t.length;for(i=0;i<s;++i){t[i].call(this,arguments[1])}}else{n=[];i=arguments.length;for(i=1;i<arguments.length;++i){n.push(arguments[i])}s=t.length;for(i=0;i<s;++i){t[i].apply(this,n)}}};this.dispose=function(){r={}}}};e.prototype.pipe=function(t){this.on("data",function(e){t.push(e)});this.on("done",function(e){t.flush(e)});this.on("partialdone",function(e){t.partialFlush(e)});this.on("endedtimeline",function(e){t.endTimeline(e)});this.on("reset",function(e){t.reset(e)});return t};e.prototype.push=function(e){this.trigger("data",e)};e.prototype.flush=function(e){this.trigger("done",e)};e.prototype.partialFlush=function(e){this.trigger("partialdone",e)};e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)};e.prototype.reset=function(e){this.trigger("reset",e)};var t=e;var U=Math.pow(2,32);var B=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);var i;if(t.getBigUint64){i=t.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return t.getUint32(0)*U+t.getUint32(4)};var F={getUint64:B,MAX_UINT32:U};var q=F.MAX_UINT32;var c,j,V,$,H,G,z,W,Y,X,K,Q,J,Z,ee,te,ie,se,ne,re,ae,oe,u,le,ce,ue,de,he,fe,pe,me,ge,ye,_e,ve,be;(function(){var e;u={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if(typeof Uint8Array==="undefined"){return}for(e in u){if(u.hasOwnProperty(e)){u[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]}}le=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);ue=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);ce=new Uint8Array([0,0,0,1]);de=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]);he=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);fe={video:de,audio:he};ge=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);me=new Uint8Array([0,0,0,0,0,0,0,0]);ye=new Uint8Array([0,0,0,0,0,0,0,0]);_e=ye;ve=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);be=ye;pe=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();c=function(e){var t=[],i=0,s,n,r;for(s=1;s<arguments.length;s++){t.push(arguments[s])}s=t.length;while(s--){i+=t[s].byteLength}n=new Uint8Array(i+8);r=new DataView(n.buffer,n.byteOffset,n.byteLength);r.setUint32(0,n.byteLength);n.set(e,4);for(s=0,i=8;s<t.length;s++){n.set(t[s],i);i+=t[s].byteLength}return n};j=function(){return c(u.dinf,c(u.dref,ge))};V=function(e){return c(u.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))};$=function(){return c(u.ftyp,le,ce,le,ue)};te=function(e){return c(u.hdlr,fe[e])};H=function(e){return c(u.mdat,e)};ee=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,e.duration&255,85,196,0,0]);if(e.samplerate){t[12]=e.samplerate>>>24&255;t[13]=e.samplerate>>>16&255;t[14]=e.samplerate>>>8&255;t[15]=e.samplerate&255}return c(u.mdhd,t)};Z=function(e){return c(u.mdia,ee(e),te(e.type),z(e))};G=function(e){return c(u.mfhd,new Uint8Array([0,0,0,0,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255]))};z=function(e){return c(u.minf,e.type==="video"?c(u.vmhd,pe):c(u.smhd,me),j(),se(e))};W=function(e,t){var i=[],s=t.length;while(s--){i[s]=re(t[s])}return c.apply(null,[u.moof,G(e)].concat(i))};Y=function(e){var t=e.length,i=[];while(t--){i[t]=Q(e[t])}return c.apply(null,[u.moov,K(4294967295)].concat(i).concat(X(e)))};X=function(e){var t=e.length,i=[];while(t--){i[t]=ae(e[t])}return c.apply(null,[u.mvex].concat(i))};K=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return c(u.mvhd,t)};ie=function(e){var t=e.samples||[],i=new Uint8Array(4+t.length),s,n;for(n=0;n<t.length;n++){s=t[n].flags;i[n+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return c(u.sdtp,i)};se=function(e){return c(u.stbl,ne(e),c(u.stts,be),c(u.stsc,_e),c(u.stsz,ve),c(u.stco,ye))};(function(){var t,i;ne=function(e){return c(u.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),e.type==="video"?t(e):i(e))};t=function(e){var t=e.sps||[],i=e.pps||[],s=[],n=[],r,a;for(r=0;r<t.length;r++){s.push((t[r].byteLength&65280)>>>8);s.push(t[r].byteLength&255);s=s.concat(Array.prototype.slice.call(t[r]))}for(r=0;r<i.length;r++){n.push((i[r].byteLength&65280)>>>8);n.push(i[r].byteLength&255);n=n.concat(Array.prototype.slice.call(i[r]))}a=[u.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e.width&65280)>>8,e.width&255,(e.height&65280)>>8,e.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c(u.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],s,[i.length],n))),c(u.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];a.push(c(u.pasp,new Uint8Array([(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255])))}return c.apply(null,a)};i=function(e){return c(u.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(e.channelcount&65280)>>8,e.channelcount&255,(e.samplesize&65280)>>8,e.samplesize&255,0,0,0,0,(e.samplerate&65280)>>8,e.samplerate&255,0,0]),V(e))}})();J=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,0,(e.duration&4278190080)>>24,(e.duration&16711680)>>16,(e.duration&65280)>>8,e.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(e.width&65280)>>8,e.width&255,0,0,(e.height&65280)>>8,e.height&255,0,0]);return c(u.tkhd,t)};re=function(e){var t,i,s,n,r,a,o;t=c(u.tfhd,new Uint8Array([0,0,0,58,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));a=Math.floor(e.baseMediaDecodeTime/q);o=Math.floor(e.baseMediaDecodeTime%q);i=c(u.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,a&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255]));r=32+20+8+16+8+8;if(e.type==="audio"){s=oe(e,r);return c(u.traf,t,i,s)}n=ie(e);s=oe(e,n.length+r);return c(u.traf,t,i,s,n)};Q=function(e){e.duration=e.duration||4294967295;return c(u.trak,J(e),Z(e))};ae=function(e){var t=new Uint8Array([0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(e.type!=="video"){t[t.length-1]=0}return c(u.trex,t)};(function(){var i,s,l;l=function(e,t){var i=0,s=0,n=0,r=0;if(e.length){if(e[0].duration!==undefined){i=1}if(e[0].size!==undefined){s=2}if(e[0].flags!==undefined){n=4}if(e[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|s|n|r,1,(e.length&4278190080)>>>24,(e.length&16711680)>>>16,(e.length&65280)>>>8,e.length&255,(t&4278190080)>>>24,(t&16711680)>>>16,(t&65280)>>>8,t&255]};s=function(e,t){var i,s,n,r,a,o;r=e.samples||[];t+=8+12+16*r.length;n=l(r,t);s=new Uint8Array(n.length+r.length*16);s.set(n);i=n.length;for(o=0;o<r.length;o++){a=r[o];s[i++]=(a.duration&4278190080)>>>24;s[i++]=(a.duration&16711680)>>>16;s[i++]=(a.duration&65280)>>>8;s[i++]=a.duration&255;s[i++]=(a.size&4278190080)>>>24;s[i++]=(a.size&16711680)>>>16;s[i++]=(a.size&65280)>>>8;s[i++]=a.size&255;s[i++]=a.flags.isLeading<<2|a.flags.dependsOn;s[i++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample;s[i++]=a.flags.degradationPriority&240<<8;s[i++]=a.flags.degradationPriority&15;s[i++]=(a.compositionTimeOffset&4278190080)>>>24;s[i++]=(a.compositionTimeOffset&16711680)>>>16;s[i++]=(a.compositionTimeOffset&65280)>>>8;s[i++]=a.compositionTimeOffset&255}return c(u.trun,s)};i=function(e,t){var i,s,n,r,a,o;r=e.samples||[];t+=8+12+8*r.length;n=l(r,t);i=new Uint8Array(n.length+r.length*8);i.set(n);s=n.length;for(o=0;o<r.length;o++){a=r[o];i[s++]=(a.duration&4278190080)>>>24;i[s++]=(a.duration&16711680)>>>16;i[s++]=(a.duration&65280)>>>8;i[s++]=a.duration&255;i[s++]=(a.size&4278190080)>>>24;i[s++]=(a.size&16711680)>>>16;i[s++]=(a.size&65280)>>>8;i[s++]=a.size&255}return c(u.trun,i)};oe=function(e,t){if(e.type==="audio"){return i(e,t)}return s(e,t)}})();var Te={ftyp:$,mdat:H,moof:W,moov:Y,initSegment:function(e){var t=$(),i=Y(e),s;s=new Uint8Array(t.byteLength+i.byteLength);s.set(t);s.set(i,t.byteLength);return s}};var Se=function(e){var t,i,s=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;s.byteLength=0;for(t=0;t<e.length;t++){i=e[t];if(i.nalUnitType==="access_unit_delimiter_rbsp"){if(s.length){s.duration=i.dts-s.dts;n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s)}s=[i];s.byteLength=i.data.byteLength;s.pts=i.pts;s.dts=i.dts}else{if(i.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"){s.keyFrame=true}s.duration=i.dts-s.dts;s.byteLength+=i.data.byteLength;s.push(i)}}if(n.length&&(!s.duration||s.duration<=0)){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s);return n};var Ee=function(e){var t,i,s=[],n=[];s.byteLength=0;s.nalCount=0;s.duration=0;s.pts=e[0].pts;s.dts=e[0].dts;n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=e[0].pts;n.dts=e[0].dts;for(t=0;t<e.length;t++){i=e[t];if(i.keyFrame){if(s.length){n.push(s);n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration}s=[i];s.nalCount=i.length;s.byteLength=i.byteLength;s.pts=i.pts;s.dts=i.dts;s.duration=i.duration}else{s.duration+=i.duration;s.nalCount+=i.length;s.byteLength+=i.byteLength;s.push(i)}}if(n.length&&s.duration<=0){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration;n.push(s);return n};var we=function(e){var t;if(!e[0][0].keyFrame&&e.length>1){t=e.shift();e.byteLength-=t.byteLength;e.nalCount-=t.nalCount;e[0][0].dts=t.dts;e[0][0].pts=t.pts;e[0][0].duration+=t.duration}return e};var Ie=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var Ce=function(e,t){var i=Ie();i.dataOffset=t;i.compositionTimeOffset=e.pts-e.dts;i.duration=e.duration;i.size=4*e.length;i.size+=e.byteLength;if(e.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var ke=function(e,t){var i,s,n,r,a,o=t||0,l=[];for(i=0;i<e.length;i++){r=e[i];for(s=0;s<r.length;s++){a=r[s];n=Ce(a,o);o+=n.size;l.push(n)}}return l};var Ae=function(e){var t,i,s,n,r,a,o=0,l=e.byteLength,c=e.nalCount,u=l+4*c,d=new Uint8Array(u),h=new DataView(d.buffer);for(t=0;t<e.length;t++){n=e[t];for(i=0;i<n.length;i++){r=n[i];for(s=0;s<r.length;s++){a=r[s];h.setUint32(o,a.data.byteLength);o+=4;d.set(a.data,o);o+=a.data.byteLength}}}return d};var De=function(e,t){var i,s=t||0,n=[];i=Ce(e,s);n.push(i);return n};var xe=function(e){var t,i,s=0,n=e.byteLength,r=e.length,a=n+4*r,o=new Uint8Array(a),l=new DataView(o.buffer);for(t=0;t<e.length;t++){i=e[t];l.setUint32(s,i.data.byteLength);s+=4;o.set(i.data,s);s+=i.data.byteLength}return o};var Oe={groupNalsIntoFrames:Se,groupFramesIntoGops:Ee,extendFirstKeyFrame:we,generateSampleTable:ke,concatenateNalData:Ae,generateSampleTableForFrame:De,concatenateNalDataForFrame:xe};var i=[33,16,5,32,164,27];var Pe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var s=function(e){var t=[];while(e--){t.push(0)}return t};var Re=function(i){return Object.keys(i).reduce(function(e,t){e[t]=new Uint8Array(i[t].reduce(function(e,t){return e.concat(t)},[]));return e},{})};var Le;var Ne=function(){if(!Le){var e={96e3:[i,[227,64],s(154),[56]],88200:[i,[231],s(170),[56]],64e3:[i,[248,192],s(240),[56]],48e3:[i,[255,192],s(268),[55,148,128],s(54),[112]],44100:[i,[255,192],s(268),[55,163,128],s(84),[112]],32e3:[i,[255,192],s(268),[55,234],s(226),[112]],24e3:[i,[255,192],s(268),[55,255,128],s(268),[111,112],s(126),[224]],16e3:[i,[255,192],s(268),[55,255,128],s(268),[111,255],s(269),[223,108],s(195),[1,192]],12e3:[Pe,s(268),[3,127,248],s(268),[6,255,240],s(268),[13,255,224],s(268),[27,253,128],s(259),[56]],11025:[Pe,s(268),[3,127,248],s(268),[6,255,240],s(268),[13,255,224],s(268),[27,255,192],s(268),[55,175,128],s(108),[112]],8e3:[Pe,s(268),[3,121,16],s(47),[7]]};Le=Re(e)}return Le};var Me=9e4,Ue,Be,Fe,qe,je,Ve,$e;Ue=function(e){return e*Me};Be=function(e,t){return e*t};Fe=function(e){return e/Me};qe=function(e,t){return e/t};je=function(e,t){return Ue(qe(e,t))};Ve=function(e,t){return Be(Fe(e),t)};$e=function(e,t,i){return Fe(i?e:e-t)};var r={ONE_SECOND_IN_TS:Me,secondsToVideoTs:Ue,secondsToAudioTs:Be,videoTsToSeconds:Fe,audioTsToSeconds:qe,audioTsToVideoTs:je,videoTsToAudioTs:Ve,metadataTsToSeconds:$e};var He=Ne;var Ge=r;var ze=function(e){var t,i,s=0;for(t=0;t<e.length;t++){i=e[t];s+=i.data.byteLength}return s};var We=function(e,t,i,s){var n,r=0,a=0,o=0,l=0,c,u,d;if(!t.length){return}n=Ge.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate);r=Math.ceil(Ge.ONE_SECOND_IN_TS/(e.samplerate/1024));if(i&&s){a=n-Math.max(i,s);o=Math.floor(a/r);l=o*r}if(o<1||l>Ge.ONE_SECOND_IN_TS/2){return}c=He()[e.samplerate];if(!c){c=t[0].data}for(u=0;u<o;u++){d=t[0];t.splice(0,0,{data:c,dts:d.dts-r,pts:d.pts-r})}e.baseMediaDecodeTime-=Math.floor(Ge.videoTsToAudioTs(l,e.samplerate));return l};var Ye=function(e,t,i){if(t.minSegmentDts>=i){return e}t.minSegmentDts=Infinity;return e.filter(function(e){if(e.dts>=i){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return true}return false})};var Xe=function(e){var t,i,s=[];for(t=0;t<e.length;t++){i=e[t];s.push({size:i.data.byteLength,duration:1024})}return s};var Ke=function(e){var t,i,s=0,n=new Uint8Array(ze(e));for(t=0;t<e.length;t++){i=e[t];n.set(i.data,s);s+=i.data.byteLength}return n};var Qe={prefixWithSilence:We,trimAdtsFramesByEarliestDts:Ye,generateSampleTable:Xe,concatenateFrameData:Ke};var Je=r.ONE_SECOND_IN_TS;var Ze=function(e,t){if(typeof t.pts==="number"){if(e.timelineStartInfo.pts===undefined){e.timelineStartInfo.pts=t.pts}if(e.minSegmentPts===undefined){e.minSegmentPts=t.pts}else{e.minSegmentPts=Math.min(e.minSegmentPts,t.pts)}if(e.maxSegmentPts===undefined){e.maxSegmentPts=t.pts}else{e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)}}if(typeof t.dts==="number"){if(e.timelineStartInfo.dts===undefined){e.timelineStartInfo.dts=t.dts}if(e.minSegmentDts===undefined){e.minSegmentDts=t.dts}else{e.minSegmentDts=Math.min(e.minSegmentDts,t.dts)}if(e.maxSegmentDts===undefined){e.maxSegmentDts=t.dts}else{e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts)}}};var et=function(e){delete e.minSegmentDts;delete e.maxSegmentDts;delete e.minSegmentPts;delete e.maxSegmentPts};var tt=function(e,t){var i,s,n=e.minSegmentDts;if(!t){n-=e.timelineStartInfo.dts}i=e.timelineStartInfo.baseMediaDecodeTime;i+=n;i=Math.max(0,i);if(e.type==="audio"){s=e.samplerate/Je;i*=s;i=Math.floor(i)}return i};var it={clearDtsInfo:et,calculateTrackBaseMediaDecodeTime:tt,collectDtsInfo:Ze};var st=4,nt=128;var rt=function(e){var t=0,i={payloadType:-1,payloadSize:0},s=0,n=0;while(t<e.byteLength){if(e[t]===nt){break}while(e[t]===255){s+=255;t++}s+=e[t++];while(e[t]===255){n+=255;t++}n+=e[t++];if(!i.payload&&s===st){var r=String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6]);if(r==="GA94"){i.payloadType=s;i.payloadSize=n;i.payload=e.subarray(t,t+n);break}else{i.payload=void 0}}t+=n;s=0;n=0}return i};var at=function(e){if(e.payload[0]!==181){return null}if((e.payload[1]<<8|e.payload[2])!==49){return null}if(String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])!=="GA94"){return null}if(e.payload[7]!==3){return null}return e.payload.subarray(8,e.payload.length-1)};var ot=function(e,t){var i=[],s,n,r,a;if(!(t[0]&64)){return i}n=t[0]&31;for(s=0;s<n;s++){r=s*3;a={type:t[r+2]&3,pts:e};if(t[r+2]&4){a.ccData=t[r+3]<<8|t[r+4];i.push(a)}}return i};var lt=function(e){var t=e.byteLength,i=[],s=1,n,r;while(s<t-2){if(e[s]===0&&e[s+1]===0&&e[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return e}n=t-i.length;r=new Uint8Array(n);var a=0;for(s=0;s<n;a++,s++){if(a===i[0]){a++;i.shift()}r[s]=e[a]}return r};var ct={parseSei:rt,parseUserData:at,parseCaptionPackets:ot,discardEmulationPreventionBytes:lt,USER_DATA_REGISTERED_ITU_T_T35:st};var ut=t;var dt=ct;var n=function(e){e=e||{};n.prototype.init.call(this);this.parse708captions_=typeof e.parse708captions==="boolean"?e.parse708captions:true;this.captionPackets_=[];this.ccStreams_=[new l(0,0),new l(0,1),new l(1,0),new l(1,1)];if(this.parse708captions_){this.cc708Stream_=new o({captionServices:e.captionServices})}this.reset();this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data"));e.on("partialdone",this.trigger.bind(this,"partialdone"));e.on("done",this.trigger.bind(this,"done"))},this);if(this.parse708captions_){this.cc708Stream_.on("data",this.trigger.bind(this,"data"));this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone"));this.cc708Stream_.on("done",this.trigger.bind(this,"done"))}};n.prototype=new ut;n.prototype.push=function(e){var t,i,s;if(e.nalUnitType!=="sei_rbsp"){return}t=dt.parseSei(e.escapedRBSP);if(!t.payload){return}if(t.payloadType!==dt.USER_DATA_REGISTERED_ITU_T_T35){return}i=dt.parseUserData(t);if(!i){return}if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}s=dt.parseCaptionPackets(e.pts,i);this.captionPackets_=this.captionPackets_.concat(s);if(this.latestDts_!==e.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=e.dts};n.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(e){return t==="flush"?e.flush():e.partialFlush()},this)};n.prototype.flushStream=function(e){if(!this.captionPackets_.length){this.flushCCStreams(e);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t});this.captionPackets_.sort(function(e,t){if(e.pts===t.pts){return e.presortIndex-t.presortIndex}return e.pts-t.pts});this.captionPackets_.forEach(function(e){if(e.type<2){this.dispatchCea608Packet(e)}else{this.dispatchCea708Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};n.prototype.flush=function(){return this.flushStream("flush")};n.prototype.partialFlush=function(){return this.flushStream("partialFlush")};n.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};n.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(this.activeCea608Channel_[e.type]===null){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};n.prototype.setsChannel1Active=function(e){return(e.ccData&30720)===4096};n.prototype.setsChannel2Active=function(e){return(e.ccData&30720)===6144};n.prototype.setsTextOrXDSActive=function(e){return(e.ccData&28928)===256||(e.ccData&30974)===4138||(e.ccData&30974)===6186};n.prototype.dispatchCea708Packet=function(e){if(this.parse708captions_){this.cc708Stream_.push(e)}};var ht={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600};var ft=function(e){var t=ht[e]||e;if(e&4096&&e===t){return""}return String.fromCharCode(t)};var pt=function(e){return 32<=e&&e<=127||160<=e&&e<=255};var a=function(e){this.windowNum=e;this.reset()};a.prototype.reset=function(){this.clearText();this.pendingNewLine=false;this.winAttr={};this.penAttr={};this.penLoc={};this.penColor={};this.visible=0;this.rowLock=0;this.columnLock=0;this.priority=0;this.relativePositioning=0;this.anchorVertical=0;this.anchorHorizontal=0;this.anchorPoint=0;this.rowCount=1;this.virtualRowCount=this.rowCount+1;this.columnCount=41;this.windowStyle=0;this.penStyle=0};a.prototype.getText=function(){return this.rows.join("\n")};a.prototype.clearText=function(){this.rows=[""];this.rowIdx=0};a.prototype.newLine=function(e){if(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(e)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};a.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};a.prototype.addText=function(e){this.rows[this.rowIdx]+=e};a.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var mt=function(e,t,i){this.serviceNum=e;this.text="";this.currentWindow=new a(-1);this.windows=[];this.stream=i;if(typeof t==="string"){this.createTextDecoder(t)}};mt.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++){this.windows[i]=new a(i);if(typeof t==="function"){this.windows[i].beforeRowOverflow=t}}};mt.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};mt.prototype.createTextDecoder=function(t){if(typeof TextDecoder==="undefined"){this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"})}else{try{this.textDecoder_=new TextDecoder(t)}catch(e){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+t+" encoding. "+e})}}};var o=function(e){e=e||{};o.prototype.init.call(this);var t=this;var i=e.captionServices||{};var s={};var n;Object.keys(i).forEach(e=>{n=i[e];if(/^SERVICE/.test(e)){s[e]=n.encoding}});this.serviceEncodings=s;this.current708Packet=null;this.services={};this.push=function(e){if(e.type===3){t.new708Packet();t.add708Bytes(e)}else{if(t.current708Packet===null){t.new708Packet()}t.add708Bytes(e)}}};o.prototype=new ut;o.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};o.prototype.add708Bytes=function(e){var t=e.ccData;var i=t>>>8;var s=t&255;this.current708Packet.ptsVals.push(e.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(s)};o.prototype.push708Packet=function(){var e=this.current708Packet;var t=e.data;var i=null;var s=null;var n=0;var r=t[n++];e.seq=r>>6;e.sizeCode=r&63;for(;n<t.length;n++){r=t[n++];i=r>>5;s=r&31;if(i===7&&s>0){r=t[n++];i=r}this.pushServiceBlock(i,n,s);if(s>0){n+=s-1}}};o.prototype.pushServiceBlock=function(e,t,i){var s;var n=t;var r=this.current708Packet.data;var a=this.services[e];if(!a){a=this.initService(e,n)}for(;n<t+i&&n<r.length;n++){s=r[n];if(pt(s)){n=this.handleText(n,a)}else if(s===24){n=this.multiByteCharacter(n,a)}else if(s===16){n=this.extendedCommands(n,a)}else if(128<=s&&s<=135){n=this.setCurrentWindow(n,a)}else if(152<=s&&s<=159){n=this.defineWindow(n,a)}else if(s===136){n=this.clearWindows(n,a)}else if(s===140){n=this.deleteWindows(n,a)}else if(s===137){n=this.displayWindows(n,a)}else if(s===138){n=this.hideWindows(n,a)}else if(s===139){n=this.toggleWindows(n,a)}else if(s===151){n=this.setWindowAttributes(n,a)}else if(s===144){n=this.setPenAttributes(n,a)}else if(s===145){n=this.setPenColor(n,a)}else if(s===146){n=this.setPenLocation(n,a)}else if(s===143){a=this.reset(n,a)}else if(s===8){a.currentWindow.backspace()}else if(s===12){a.currentWindow.clearText()}else if(s===13){a.currentWindow.pendingNewLine=true}else if(s===14){a.currentWindow.clearText()}else if(s===141){n++}else;}};o.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data;var s=i[++e];if(pt(s)){e=this.handleText(e,t,{isExtended:true})}return e};o.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]};o.prototype.initService=function(t,e){var i="SERVICE"+t;var s=this;var i;var n;if(i in this.serviceEncodings){n=this.serviceEncodings[i]}this.services[t]=new mt(t,n,s);this.services[t].init(this.getPts(e),function(e){s.flushDisplayed(e,s.services[t])});return this.services[t]};o.prototype.handleText=function(e,t,i){var s=i&&i.isExtended;var n=i&&i.isMultiByte;var r=this.current708Packet.data;var a=s?4096:0;var o=r[e];var l=r[e+1];var c=t.currentWindow;var u;var d;function h(e){return e.map(e=>{return("0"+(e&255).toString(16)).slice(-2)}).join("")}if(n){d=[o,l];e++}else{d=[o]}if(t.textDecoder_&&!s){u=t.textDecoder_.decode(new Uint8Array(d))}else{if(n){const f=h(d);u=String.fromCharCode(parseInt(f,16))}else{u=ft(a|o)}}if(c.pendingNewLine&&!c.isEmpty()){c.newLine(this.getPts(e))}c.pendingNewLine=false;c.addText(u);return e};o.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data;var s=i[e+1];var n=i[e+2];if(pt(s)&&pt(n)){e=this.handleText(++e,t,{isMultiByte:true})}return e};o.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=s&7;t.setCurrentWindow(n);return e};o.prototype.defineWindow=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=s&7;t.setCurrentWindow(n);var r=t.currentWindow;s=i[++e];r.visible=(s&32)>>5;r.rowLock=(s&16)>>4;r.columnLock=(s&8)>>3;r.priority=s&7;s=i[++e];r.relativePositioning=(s&128)>>7;r.anchorVertical=s&127;s=i[++e];r.anchorHorizontal=s;s=i[++e];r.anchorPoint=(s&240)>>4;r.rowCount=s&15;s=i[++e];r.columnCount=s&63;s=i[++e];r.windowStyle=(s&56)>>3;r.penStyle=s&7;r.virtualRowCount=r.rowCount+1;return e};o.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.winAttr;s=i[++e];n.fillOpacity=(s&192)>>6;n.fillRed=(s&48)>>4;n.fillGreen=(s&12)>>2;n.fillBlue=s&3;s=i[++e];n.borderType=(s&192)>>6;n.borderRed=(s&48)>>4;n.borderGreen=(s&12)>>2;n.borderBlue=s&3;s=i[++e];n.borderType+=(s&128)>>5;n.wordWrap=(s&64)>>6;n.printDirection=(s&48)>>4;n.scrollDirection=(s&12)>>2;n.justify=s&3;s=i[++e];n.effectSpeed=(s&240)>>4;n.effectDirection=(s&12)>>2;n.displayEffect=s&3;return e};o.prototype.flushDisplayed=function(e,t){var i=[];for(var s=0;s<8;s++){if(t.windows[s].visible&&!t.windows[s].isEmpty()){i.push(t.windows[s].getText())}}t.endPts=e;t.text=i.join("\n\n");this.pushCaption(t);t.startPts=e};o.prototype.pushCaption=function(e){if(e.text!==""){this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum});e.text="";e.startPts=e.endPts}};o.prototype.displayWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].visible=1}}return e};o.prototype.hideWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].visible=0}}return e};o.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].visible^=1}}return e};o.prototype.clearWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].clearText()}}return e};o.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<<r){t.windows[r].reset()}}return e};o.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penAttr;s=i[++e];n.textTag=(s&240)>>4;n.offset=(s&12)>>2;n.penSize=s&3;s=i[++e];n.italics=(s&128)>>7;n.underline=(s&64)>>6;n.edgeType=(s&56)>>3;n.fontStyle=s&7;return e};o.prototype.setPenColor=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penColor;s=i[++e];n.fgOpacity=(s&192)>>6;n.fgRed=(s&48)>>4;n.fgGreen=(s&12)>>2;n.fgBlue=s&3;s=i[++e];n.bgOpacity=(s&192)>>6;n.bgRed=(s&48)>>4;n.bgGreen=(s&12)>>2;n.bgBlue=s&3;s=i[++e];n.edgeRed=(s&48)>>4;n.edgeGreen=(s&12)>>2;n.edgeBlue=s&3;return e};o.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penLoc;t.currentWindow.pendingNewLine=true;s=i[++e];n.row=s&15;s=i[++e];n.column=s&63;return e};o.prototype.reset=function(e,t){var i=this.getPts(e);this.flushDisplayed(i,t);return this.initService(t.serviceNum,e)};var gt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496};var yt=function(e){if(e===null){return""}e=gt[e]||e;return String.fromCharCode(e)};var _t=14;var vt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var d=function(){var e=[],t=_t+1;while(t--){e.push({text:"",indent:0,offset:0})}return e};var l=function(e,t){l.prototype.init.call(this);this.field_=e||0;this.dataChannel_=t||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,i,s,n,r;t=e.ccData&32639;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)===4096){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}s=t>>>8;n=t&255;if(t===this.PADDING_){return}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=d()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=d()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(e.pts);this.displayed_=d()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(s,n)){s=(s&3)<<8;r=yt(s|n);this[this.mode_](e.pts,r);this.column_++}else if(this.isExtCharacter(s,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}s=(s&3)<<8;r=yt(s|n);this[this.mode_](e.pts,r);this.column_++}else if(this.isMidRowCode(s,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if((n&14)===14){this.addFormatting(e.pts,["i"])}if((n&1)===1){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(s,n)){const o=n&3;this.nonDisplayed_[this.row_].offset=o;this.column_+=o}else if(this.isPAC(s,n)){var a=vt.indexOf(t&7968);if(this.mode_==="rollUp"){if(a-this.rollUpRows_+1<0){a=this.rollUpRows_-1}this.setRollUp(e.pts,a)}if(a!==this.row_&&a>=0&&a<=14){this.clearFormatting(e.pts);this.row_=a}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(e.pts,["u"])}if((t&16)===16){const l=(t&14)>>1;this.column_=l*4;this.nonDisplayed_[this.row_].indent+=l}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(s)){if(n===0){n=null}r=yt(s);r+=yt(n);this[this.mode_](e.pts,r);this.column_+=r.length}}};l.prototype=new ut;l.prototype.flushDisplayed=function(e){const i=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})};const s=[];this.displayed_.forEach((e,t)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){i(t)}if(e.text.length){s.push({text:e.text,line:t+1,position:10+Math.min(70,e.indent*10)+e.offset*2.5})}}else if(e===undefined||e===null){i(t)}});if(s.length){this.trigger("data",{startPts:this.startPts_,endPts:e,content:s,stream:this.name_})}};l.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=d();this.nonDisplayed_=d();this.lastControlCode_=null;this.column_=0;this.row_=_t;this.rollUpRows_=2;this.formatting_=[]};l.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(this.dataChannel_===1){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};l.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63};l.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63};l.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47};l.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35};l.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127};l.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127};l.prototype.isNormalChar=function(e){return e>=32&&e<=127};l.prototype.setRollUp=function(e,t){if(this.mode_!=="rollUp"){this.row_=_t;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=d();this.displayed_=d()}if(t!==undefined&&t!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[t-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]={text:"",indent:0,offset:0}}}if(t===undefined){t=this.row_}this.topRow_=t-this.rollUpRows_+1};l.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)};l.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[];this[this.mode_](e,t)};l.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t;this.nonDisplayed_[this.row_].text=i};l.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t;this.displayed_[this.row_].text=i};l.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++){this.displayed_[e]={text:"",indent:0,offset:0}}for(e=this.row_+1;e<_t+1;e++){this.displayed_[e]={text:"",indent:0,offset:0}}for(e=this.topRow_;e<this.row_;e++){this.displayed_[e]=this.displayed_[e+1]}this.displayed_[this.row_]={text:"",indent:0,offset:0}};l.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t;this.displayed_[this.row_].text=i};var bt={CaptionStream:n,Cea608Stream:l,Cea708Stream:o};var Tt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var St=t;var Et=8589934592;var wt=4294967296;var It="shared";var Ct=function(e,t){var i=1;if(e>t){i=-1}while(Math.abs(t-e)>wt){e+=i*Et}return e};var kt=function(e){var t,i;kt.prototype.init.call(this);this.type_=e||It;this.push=function(e){if(e.type==="metadata"){this.trigger("data",e);return}if(this.type_!==It&&e.type!==this.type_){return}if(i===undefined){i=e.dts}e.dts=Ct(e.dts,i);e.pts=Ct(e.pts,i);t=e.dts;this.trigger("data",e)};this.flush=function(){i=t;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){i=void 0;t=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};kt.prototype=new St;var At={TimestampRolloverStream:kt,handleRollover:Ct};var Dt=(e,t,i)=>{if(!e){return-1}var s=i;for(;s<e.length;s++){if(e[s]===t){return s}}return-1};var xt={typedArrayIndexOf:Dt};var Ot=xt.typedArrayIndexOf,Pt={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},Rt=function(e,t,i){var s,n="";for(s=t;s<i;s++){n+="%"+("00"+e[s].toString(16)).slice(-2)}return n},h=function(e,t,i){return decodeURIComponent(Rt(e,t,i))},f=function(e,t,i){return unescape(Rt(e,t,i))},p=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},m={APIC:function(e){var t=1,i,s,n="--\x3e";if(e.data[0]!==Pt.Utf8){return}i=Ot(e.data,0,t);if(i<0){return}e.mimeType=f(e.data,t,i);t=i+1;e.pictureType=e.data[t];t++;s=Ot(e.data,0,t);if(s<0){return}e.description=h(e.data,t,s);t=s+1;if(e.mimeType===n){e.url=f(e.data,t,e.data.length)}else{e.pictureData=e.data.subarray(t,e.data.length)}},"T*":function(e){if(e.data[0]!==Pt.Utf8){return}e.value=h(e.data,1,e.data.length).replace(/\0*$/,"");e.values=e.value.split("\0")},TXXX:function(e){var t;if(e.data[0]!==Pt.Utf8){return}t=Ot(e.data,0,1);if(t===-1){return}e.description=h(e.data,1,t);e.value=h(e.data,t+1,e.data.length).replace(/\0*$/,"");e.data=e.value},"W*":function(e){e.url=f(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;if(e.data[0]!==Pt.Utf8){return}t=Ot(e.data,0,1);if(t===-1){return}e.description=h(e.data,1,t);e.url=f(e.data,t+1,e.data.length).replace(/\0.*$/,"")},PRIV:function(e){var t;for(t=0;t<e.data.length;t++){if(e.data[t]===0){e.owner=f(e.data,0,t);break}}e.privateData=e.data.subarray(t+1);e.data=e.privateData}};var Lt=function(e){var t,i,s=10,n=0,r=[];if(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0)){return}n=p(e.subarray(6,10));n+=10;var a=e[5]&64;if(a){s+=4;s+=p(e.subarray(10,14));n-=p(e.subarray(16,20))}do{t=p(e.subarray(s+4,s+8));if(t<1){break}i=String.fromCharCode(e[s],e[s+1],e[s+2],e[s+3]);var o={id:i,data:e.subarray(s+10,s+t+10)};o.key=o.id;if(m[o.id]){m[o.id](o)}else if(o.id[0]==="T"){m["T*"](o)}else if(o.id[0]==="W"){m["W*"](o)}r.push(o);s+=10;s+=t}while(s<n);return r};var Nt={parseId3Frames:Lt,parseSyncSafeInteger:p,frameParsers:m};var Mt=t,Ut=Tt,g=Nt,Bt;Bt=function(e){var t={descriptor:e&&e.descriptor},c=0,u=[],d=0,i;Bt.prototype.init.call(this);this.dispatchType=Ut.METADATA_STREAM_TYPE.toString(16);if(t.descriptor){for(i=0;i<t.descriptor.length;i++){this.dispatchType+=("00"+t.descriptor[i].toString(16)).slice(-2)}}this.push=function(e){var t,i,s,n,r,a;if(e.type!=="timed-metadata"){return}if(e.dataAlignmentIndicator){d=0;u.length=0}if(u.length===0&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}u.push(e);d+=e.data.byteLength;if(u.length===1){c=g.parseSyncSafeInteger(e.data.subarray(6,10));c+=10}if(d<c){return}t={data:new Uint8Array(c),frames:[],pts:u[0].pts,dts:u[0].dts};for(r=0;r<c;){t.data.set(u[0].data.subarray(0,c-r),r);r+=u[0].data.byteLength;d-=u[0].data.byteLength;u.shift()}i=10;if(t.data[5]&64){i+=4;i+=g.parseSyncSafeInteger(t.data.subarray(10,14));c-=g.parseSyncSafeInteger(t.data.subarray(16,20))}do{s=g.parseSyncSafeInteger(t.data.subarray(i+4,i+8));if(s<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}a=String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]);n={id:a,data:t.data.subarray(i+10,i+s+10)};n.key=n.id;if(g.frameParsers[n.id]){g.frameParsers[n.id](n)}else if(n.id[0]==="T"){g.frameParsers["T*"](n)}else if(n.id[0]==="W"){g.frameParsers["W*"](n)}if(n.owner==="com.apple.streaming.transportStreamTimestamp"){var o=n.data,l=(o[3]&1)<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;l*=4;l+=o[7]&3;n.timeStamp=l;if(t.pts===undefined&&t.dts===undefined){t.pts=n.timeStamp;t.dts=n.timeStamp}this.trigger("timestamp",n)}t.frames.push(n);i+=10;i+=s}while(i<c);this.trigger("data",t)}};Bt.prototype=new Mt;var Ft=Bt;var qt=t,jt=bt,y=Tt,Vt=At.TimestampRolloverStream;var $t,_,Ht;var v=188,Gt=71;$t=function(){var n=new Uint8Array(v),r=0;$t.prototype.init.call(this);this.push=function(e){var t=0,i=v,s;if(r){s=new Uint8Array(e.byteLength+r);s.set(n.subarray(0,r));s.set(e,r);r=0}else{s=e}while(i<s.byteLength){if(s[t]===Gt&&s[i]===Gt){this.trigger("data",s.subarray(t,i));t+=v;i+=v;continue}t++;i++}if(t<s.byteLength){n.set(s.subarray(t),0);r=s.byteLength-t}};this.flush=function(){if(r===v&&n[0]===Gt){this.trigger("data",n);r=0}this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.reset=function(){r=0;this.trigger("reset")}};$t.prototype=new qt;_=function(){var s,n,r,l;_.prototype.init.call(this);l=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;s=function(e,t){var i=0;if(t.payloadUnitStartIndicator){i+=e[i]+1}if(t.type==="pat"){n(e.subarray(i),t)}else{r(e.subarray(i),t)}};n=function(e,t){t.section_number=e[7];t.last_section_number=e[8];l.pmtPid=(e[10]&31)<<8|e[11];t.pmtPid=l.pmtPid};r=function(e,t){var i,s,n,r;if(!(e[5]&1)){return}l.programMapTable={video:null,audio:null,"timed-metadata":{}};i=(e[1]&15)<<8|e[2];s=3+i-4;n=(e[10]&15)<<8|e[11];r=12+n;while(r<s){var a=e[r];var o=(e[r+1]&31)<<8|e[r+2];if(a===y.H264_STREAM_TYPE&&l.programMapTable.video===null){l.programMapTable.video=o}else if(a===y.ADTS_STREAM_TYPE&&l.programMapTable.audio===null){l.programMapTable.audio=o}else if(a===y.METADATA_STREAM_TYPE){l.programMapTable["timed-metadata"][o]=a}r+=((e[r+3]&15)<<8|e[r+4])+5}t.programMapTable=l.programMapTable};this.push=function(e){var t={},i=4;t.payloadUnitStartIndicator=!!(e[1]&64);t.pid=e[1]&31;t.pid<<=8;t.pid|=e[2];if((e[3]&48)>>>4>1){i+=e[i]+1}if(t.pid===0){t.type="pat";s(e.subarray(i),t);this.trigger("data",t)}else if(t.pid===this.pmtPid){t.type="pmt";s(e.subarray(i),t);this.trigger("data",t);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,i,t])}else{this.processPes_(e,i,t)}};this.processPes_=function(e,t,i){if(i.pid===this.programMapTable.video){i.streamType=y.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=y.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=e.subarray(t);this.trigger("data",i)}};_.prototype=new qt;_.STREAM_TYPES={h264:27,adts:15};Ht=function(){var c=this,t=false,s={data:[],size:0},n={data:[],size:0},r={data:[],size:0},a,u=function(e,t){var i;const s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array;if(s!==1){return}t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=(e[6]&4)!==0;i=e[7];if(i&192){t.pts=(e[9]&14)<<27|(e[10]&255)<<20|(e[11]&254)<<12|(e[12]&255)<<5|(e[13]&254)>>>3;t.pts*=4;t.pts+=(e[13]&6)>>>1;t.dts=t.pts;if(i&64){t.dts=(e[14]&14)<<27|(e[15]&255)<<20|(e[16]&254)<<12|(e[17]&255)<<5|(e[18]&254)>>>3;t.dts*=4;t.dts+=(e[18]&6)>>>1}}t.data=e.subarray(9+e[8])},o=function(e,t,i){var s=new Uint8Array(e.size),n={type:t},r=0,a=0,o=false,l;if(!e.data.length||e.size<9){return}n.trackId=e.data[0].pid;for(r=0;r<e.data.length;r++){l=e.data[r];s.set(l.data,a);a+=l.data.byteLength}u(s,n);o=t==="video"||n.packetLength<=e.size;if(i||o){e.size=0;e.data.length=0}if(o){c.trigger("data",n)}};Ht.prototype.init.call(this);this.push=function(i){({pat:function(){},pes:function(){var e,t;switch(i.streamType){case y.H264_STREAM_TYPE:e=s;t="video";break;case y.ADTS_STREAM_TYPE:e=n;t="audio";break;case y.METADATA_STREAM_TYPE:e=r;t="timed-metadata";break;default:return}if(i.payloadUnitStartIndicator){o(e,t,true)}e.data.push(i);e.size+=i.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]};a=i.programMapTable;if(a.video!==null){e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.video,codec:"avc",type:"video"})}if(a.audio!==null){e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.audio,codec:"adts",type:"audio"})}t=true;c.trigger("data",e)}})[i.type]()};this.reset=function(){s.size=0;s.data.length=0;n.size=0;n.data.length=0;this.trigger("reset")};this.flushStreams_=function(){o(s,"video");o(n,"audio");o(r,"timed-metadata")};this.flush=function(){if(!t&&a){var e={type:"metadata",tracks:[]};if(a.video!==null){e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.video,codec:"avc",type:"video"})}if(a.audio!==null){e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.audio,codec:"adts",type:"audio"})}c.trigger("data",e)}t=false;this.flushStreams_();this.trigger("done")}};Ht.prototype=new qt;var zt={PAT_PID:0,MP2T_PACKET_LENGTH:v,TransportPacketStream:$t,TransportParseStream:_,ElementaryStream:Ht,TimestampRolloverStream:Vt,CaptionStream:jt.CaptionStream,Cea608Stream:jt.Cea608Stream,Cea708Stream:jt.Cea708Stream,MetadataStream:Ft};for(var Wt in y){if(y.hasOwnProperty(Wt)){zt[Wt]=y[Wt]}}var Yt=zt;var Xt=t;var Kt=r.ONE_SECOND_IN_TS;var Qt;var Jt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Qt=function(l){var c,u=0;Qt.prototype.init.call(this);this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${u} outside syncword`})};this.push=function(e){var t=0,i,s,n,r,a;if(!l){u=0}if(e.type!=="audio"){return}if(c&&c.length){n=c;c=new Uint8Array(n.byteLength+e.data.byteLength);c.set(n);c.set(e.data,n.byteLength)}else{c=e.data}var o;while(t+7<c.length){if(c[t]!==255||(c[t+1]&246)!==240){if(typeof o!=="number"){o=t}t++;continue}if(typeof o==="number"){this.skipWarn_(o,t);o=null}s=(~c[t+1]&1)*2;i=(c[t+3]&3)<<11|c[t+4]<<3|(c[t+5]&224)>>5;r=((c[t+6]&3)+1)*1024;a=r*Kt/Jt[(c[t+2]&60)>>>2];if(c.byteLength-t<i){break}this.trigger("data",{pts:e.pts+u*a,dts:e.dts+u*a,sampleCount:r,audioobjecttype:(c[t+2]>>>6&3)+1,channelcount:(c[t+2]&1)<<2|(c[t+3]&192)>>>6,samplerate:Jt[(c[t+2]&60)>>>2],samplingfrequencyindex:(c[t+2]&60)>>>2,samplesize:16,data:c.subarray(t+7+s,t+i)});u++;t+=i}if(typeof o==="number"){this.skipWarn_(o,t);o=null}c=c.subarray(t)};this.flush=function(){u=0;this.trigger("done")};this.reset=function(){c=void 0;this.trigger("reset")};this.endTimeline=function(){c=void 0;this.trigger("endedtimeline")}};Qt.prototype=new Xt;var Zt=Qt;var ei;ei=function(s){var n=s.byteLength,r=0,a=0;this.length=function(){return 8*n};this.bitsAvailable=function(){return 8*n+a};this.loadWord=function(){var e=s.byteLength-n,t=new Uint8Array(4),i=Math.min(4,n);if(i===0){throw new Error("no bytes available")}t.set(s.subarray(e,e+i));r=new DataView(t.buffer).getUint32(0);a=i*8;n-=i};this.skipBits=function(e){var t;if(a>e){r<<=e;a-=e}else{e-=a;t=Math.floor(e/8);e-=t*8;n-=t;this.loadWord();r<<=e;a-=e}};this.readBits=function(e){var t=Math.min(a,e),i=r>>>32-t;a-=t;if(a>0){r<<=t}else if(n>0){this.loadWord()}t=e-t;if(t>0){return i<<t|this.readBits(t)}return i};this.skipLeadingZeros=function(){var e;for(e=0;e<a;++e){if((r&2147483648>>>e)!==0){r<<=e;a-=e;return e}}this.loadWord();return e+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1};this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var ti=ei;var ii=t;var si=ti;var ni,b;var ri;b=function(){var s=0,n,r;b.prototype.init.call(this);this.push=function(e){var t;if(!r){r=e.data}else{t=new Uint8Array(r.byteLength+e.data.byteLength);t.set(r);t.set(e.data,r.byteLength);r=t}var i=r.byteLength;for(;s<i-3;s++){if(r[s+2]===1){n=s+5;break}}while(n<i){switch(r[n]){case 0:if(r[n-1]!==0){n+=2;break}else if(r[n-2]!==0){n++;break}if(s+3!==n-2){this.trigger("data",r.subarray(s+3,n-2))}do{n++}while(r[n]!==1&&n<i);s=n-2;n+=3;break;case 1:if(r[n-1]!==0||r[n-2]!==0){n+=3;break}this.trigger("data",r.subarray(s+3,n-2));s=n-2;n+=3;break;default:n+=3;break}}r=r.subarray(s);n-=s;s=0};this.reset=function(){r=null;s=0;this.trigger("reset")};this.flush=function(){if(r&&r.byteLength>3){this.trigger("data",r.subarray(s+3))}r=null;s=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};b.prototype=new ii;ri={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};ni=function(){var t=new b,i,s,n,r,a,o,v;ni.prototype.init.call(this);i=this;this.push=function(e){if(e.type!=="video"){return}s=e.trackId;n=e.pts;r=e.dts;t.push(e)};t.on("data",function(e){var t={trackId:s,pts:n,dts:r,data:e,nalUnitTypeCode:e[0]&31};switch(t.nalUnitTypeCode){case 5:t.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:t.nalUnitType="sei_rbsp";t.escapedRBSP=a(e.subarray(1));break;case 7:t.nalUnitType="seq_parameter_set_rbsp";t.escapedRBSP=a(e.subarray(1));t.config=o(t.escapedRBSP);break;case 8:t.nalUnitType="pic_parameter_set_rbsp";break;case 9:t.nalUnitType="access_unit_delimiter_rbsp";break}i.trigger("data",t)});t.on("done",function(){i.trigger("done")});t.on("partialdone",function(){i.trigger("partialdone")});t.on("reset",function(){i.trigger("reset")});t.on("endedtimeline",function(){i.trigger("endedtimeline")});this.flush=function(){t.flush()};this.partialFlush=function(){t.partialFlush()};this.reset=function(){t.reset()};this.endTimeline=function(){t.endTimeline()};v=function(e,t){var i=8,s=8,n,r;for(n=0;n<e;n++){if(s!==0){r=t.readExpGolomb();s=(i+r+256)%256}i=s===0?i:s}};a=function(e){var t=e.byteLength,i=[],s=1,n,r;while(s<t-2){if(e[s]===0&&e[s+1]===0&&e[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return e}n=t-i.length;r=new Uint8Array(n);var a=0;for(s=0;s<n;a++,s++){if(a===i[0]){a++;i.shift()}r[s]=e[a]}return r};o=function(e){var t=0,i=0,s=0,n=0,r,a,o,l,c,u,d,h,f,p,m,g=[1,1],y,_;r=new si(e);a=r.readUnsignedByte();l=r.readUnsignedByte();o=r.readUnsignedByte();r.skipUnsignedExpGolomb();if(ri[a]){c=r.readUnsignedExpGolomb();if(c===3){r.skipBits(1)}r.skipUnsignedExpGolomb();r.skipUnsignedExpGolomb();r.skipBits(1);if(r.readBoolean()){m=c!==3?8:12;for(_=0;_<m;_++){if(r.readBoolean()){if(_<6){v(16,r)}else{v(64,r)}}}}}r.skipUnsignedExpGolomb();u=r.readUnsignedExpGolomb();if(u===0){r.readUnsignedExpGolomb()}else if(u===1){r.skipBits(1);r.skipExpGolomb();r.skipExpGolomb();d=r.readUnsignedExpGolomb();for(_=0;_<d;_++){r.skipExpGolomb()}}r.skipUnsignedExpGolomb();r.skipBits(1);h=r.readUnsignedExpGolomb();f=r.readUnsignedExpGolomb();p=r.readBits(1);if(p===0){r.skipBits(1)}r.skipBits(1);if(r.readBoolean()){t=r.readUnsignedExpGolomb();i=r.readUnsignedExpGolomb();s=r.readUnsignedExpGolomb();n=r.readUnsignedExpGolomb()}if(r.readBoolean()){if(r.readBoolean()){y=r.readUnsignedByte();switch(y){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[r.readUnsignedByte()<<8|r.readUnsignedByte(),r.readUnsignedByte()<<8|r.readUnsignedByte()];break}}if(g){g[0]/g[1]}}}return{profileIdc:a,levelIdc:o,profileCompatibility:l,width:(h+1)*16-t*2-i*2,height:(2-p)*(f+1)*16-s*2-n*2,sarRatio:g}}};ni.prototype=new ii;var ai={H264Stream:ni,NalByteStream:b};var oi=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var li=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],s=e[t+5],n=(s&16)>>4;i=i>=0?i:0;if(n){return i+20}return i+10};var ci=function(e,t){if(e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)){return t}t+=li(e,t);return ci(e,t)};var ui=function(e){var t=ci(e,0);return e.length>=t+2&&(e[t]&255)===255&&(e[t+1]&240)===240&&(e[t+1]&22)===16};var di=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};var hi=function(e,t,i){var s,n="";for(s=t;s<i;s++){n+="%"+("00"+e[s].toString(16)).slice(-2)}return n};var fi=function(e,t,i){return unescape(hi(e,t,i))};var pi=function(e,t){var i=(e[t+5]&224)>>5,s=e[t+4]<<3,n=e[t+3]&3<<11;return n|s|i};var mi=function(e,t){if(e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(e[t]&255===255&&(e[t+1]&240)===240){return"audio"}return null};var gi=function(e){var t=0;while(t+5<e.length){if(e[t]!==255||(e[t+1]&246)!==240){t++;continue}return oi[(e[t+2]&60)>>>2]}return null};var yi=function(e){var t,i,s,n;t=10;if(e[5]&64){t+=4;t+=di(e.subarray(10,14))}do{i=di(e.subarray(t+4,t+8));if(i<1){return null}n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(n==="PRIV"){s=e.subarray(t+10,t+i+10);for(var r=0;r<s.byteLength;r++){if(s[r]===0){var a=fi(s,0,r);if(a==="com.apple.streaming.transportStreamTimestamp"){var o=s.subarray(r+1);var l=(o[3]&1)<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;l*=4;l+=o[7]&3;return l}break}}}t+=10;t+=i}while(t<e.byteLength);return null};var _i={isLikelyAacData:ui,parseId3TagSize:li,parseAdtsSize:pi,parseType:mi,parseSampleRate:gi,parseAacTimestamp:yi};var vi=t;var bi=_i;var Ti;Ti=function(){var o=new Uint8Array,l=0;Ti.prototype.init.call(this);this.setTimestamp=function(e){l=e};this.push=function(e){var t=0,i=0,s,n,r,a;if(o.length){a=o.length;o=new Uint8Array(e.byteLength+a);o.set(o.subarray(0,a));o.set(e,a)}else{o=e}while(o.length-i>=3){if(o[i]==="I".charCodeAt(0)&&o[i+1]==="D".charCodeAt(0)&&o[i+2]==="3".charCodeAt(0)){if(o.length-i<10){break}t=bi.parseId3TagSize(o,i);if(i+t>o.length){break}n={type:"timed-metadata",data:o.subarray(i,i+t)};this.trigger("data",n);i+=t;continue}else if((o[i]&255)===255&&(o[i+1]&240)===240){if(o.length-i<7){break}t=bi.parseAdtsSize(o,i);if(i+t>o.length){break}r={type:"audio",data:o.subarray(i,i+t),pts:l,dts:l};this.trigger("data",r);i+=t;continue}i++}s=o.length-i;if(s>0){o=o.subarray(i)}else{o=new Uint8Array}};this.reset=function(){o=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){o=new Uint8Array;this.trigger("endedtimeline")}};Ti.prototype=new vi;var Si=Ti;var Ei=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var wi=Ei;var Ii=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var Ci=Ii;var ki=t;var T=Te;var S=Oe;var Ai=Qe;var E=it;var w=Yt;var Di=r;var xi=Zt;var Oi=ai.H264Stream;var Pi=Si;var Ri=_i.isLikelyAacData;var Li=r.ONE_SECOND_IN_TS;var Ni=wi;var Mi=Ci;var I,C,Ui,k;var Bi=function(e,t){t.stream=e;this.trigger("log",t)};var Fi=function(e,t){var i=Object.keys(t);for(var s=0;s<i.length;s++){var n=i[s];if(n==="headOfPipeline"||!t[n].on){continue}t[n].on("log",Bi.bind(e,n))}};var qi=function(e,t){var i;if(e.length!==t.length){return false}for(i=0;i<e.length;i++){if(e[i]!==t[i]){return false}}return true};var ji=function(e,t,i,s,n,r){var a=i-t,o=s-t,l=n-i;return{start:{dts:e,pts:e+a},end:{dts:e+o,pts:e+l},prependedContentDuration:r,baseMediaDecodeTime:e}};C=function(o,l){var c=[],u,d=0,h=0,f=Infinity;l=l||{};u=l.firstSequenceNumber||0;C.prototype.init.call(this);this.push=function(t){E.collectDtsInfo(o,t);if(o){Ni.forEach(function(e){o[e]=t[e]})}c.push(t)};this.setEarliestDts=function(e){d=e};this.setVideoBaseMediaDecodeTime=function(e){f=e};this.setAudioAppendStart=function(e){h=e};this.flush=function(){var e,t,i,s,n,r,a;if(c.length===0){this.trigger("done","AudioSegmentStream");return}e=Ai.trimAdtsFramesByEarliestDts(c,o,d);o.baseMediaDecodeTime=E.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps);a=Ai.prefixWithSilence(o,e,h,f);o.samples=Ai.generateSampleTable(e);i=T.mdat(Ai.concatenateFrameData(e));c=[];t=T.moof(u,[o]);s=new Uint8Array(t.byteLength+i.byteLength);u++;s.set(t);s.set(i,t.byteLength);E.clearDtsInfo(o);n=Math.ceil(Li*1024/o.samplerate);if(e.length){r=e.length*n;this.trigger("segmentTimingInfo",ji(Di.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),e[0].dts,e[0].pts,e[0].dts+r,e[0].pts+r,a||0));this.trigger("timingInfo",{start:e[0].pts,end:e[0].pts+r})}this.trigger("data",{track:o,boxes:s});this.trigger("done","AudioSegmentStream")};this.reset=function(){E.clearDtsInfo(o);c=[];this.trigger("reset")}};C.prototype=new ki;I=function(u,d){var h,f=[],p=[],t,i;d=d||{};h=d.firstSequenceNumber||0;I.prototype.init.call(this);delete u.minPTS;this.gopCache_=[];this.push=function(e){E.collectDtsInfo(u,e);if(e.nalUnitType==="seq_parameter_set_rbsp"&&!t){t=e.config;u.sps=[e.data];Mi.forEach(function(e){u[e]=t[e]},this)}if(e.nalUnitType==="pic_parameter_set_rbsp"&&!i){i=e.data;u.pps=[e.data]}f.push(e)};this.flush=function(){var e,t,i,s,n,r,a=0,o,l;while(f.length){if(f[0].nalUnitType==="access_unit_delimiter_rbsp"){break}f.shift()}if(f.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}e=S.groupNalsIntoFrames(f);i=S.groupFramesIntoGops(e);if(!i[0][0].keyFrame){t=this.getGopForFusion_(f[0],u);if(t){a=t.duration;i.unshift(t);i.byteLength+=t.byteLength;i.nalCount+=t.nalCount;i.pts=t.pts;i.dts=t.dts;i.duration+=t.duration}else{i=S.extendFirstKeyFrame(i)}}if(p.length){var c;if(d.alignGopsAtEnd){c=this.alignGopsAtEnd_(i)}else{c=this.alignGopsAtStart_(i)}if(!c){this.gopCache_.unshift({gop:i.pop(),pps:u.pps,sps:u.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);f=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}E.clearDtsInfo(u);i=c}E.collectDtsInfo(u,i);u.samples=S.generateSampleTable(i);n=T.mdat(S.concatenateNalData(i));u.baseMediaDecodeTime=E.calculateTrackBaseMediaDecodeTime(u,d.keepOriginalTimestamps);this.trigger("processedGopsInfo",i.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}));o=i[0];l=i[i.length-1];this.trigger("segmentTimingInfo",ji(u.baseMediaDecodeTime,o.dts,o.pts,l.dts+l.duration,l.pts+l.duration,a));this.trigger("timingInfo",{start:i[0].pts,end:i[i.length-1].pts+i[i.length-1].duration});this.gopCache_.unshift({gop:i.pop(),pps:u.pps,sps:u.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);f=[];this.trigger("baseMediaDecodeTime",u.baseMediaDecodeTime);this.trigger("timelineStartInfo",u.timelineStartInfo);s=T.moof(h,[u]);r=new Uint8Array(s.byteLength+n.byteLength);h++;r.set(s);r.set(n,s.byteLength);this.trigger("data",{track:u,boxes:r});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();f=[];this.gopCache_.length=0;p.length=0;this.trigger("reset")};this.resetStream_=function(){E.clearDtsInfo(u);t=undefined;i=undefined};this.getGopForFusion_=function(e){var t=45e3,i=1e4,s=Infinity,n,r,a,o,l;for(l=0;l<this.gopCache_.length;l++){o=this.gopCache_[l];a=o.gop;if(!(u.pps&&qi(u.pps[0],o.pps[0]))||!(u.sps&&qi(u.sps[0],o.sps[0]))){continue}if(a.dts<u.timelineStartInfo.dts){continue}n=e.dts-a.dts-a.duration;if(n>=-i&&n<=t){if(!r||s>n){r=o;s=n}}}if(r){return r.gop}return null};this.alignGopsAtStart_=function(e){var t,i,s,n,r,a,o,l;r=e.byteLength;a=e.nalCount;o=e.duration;t=i=0;while(t<p.length&&i<e.length){s=p[t];n=e[i];if(s.pts===n.pts){break}if(n.pts>s.pts){t++;continue}i++;r-=n.byteLength;a-=n.nalCount;o-=n.duration}if(i===0){return e}if(i===e.length){return null}l=e.slice(i);l.byteLength=r;l.duration=o;l.nalCount=a;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsAtEnd_=function(e){var t,i,s,n,r,a;t=p.length-1;i=e.length-1;r=null;a=false;while(t>=0&&i>=0){s=p[t];n=e[i];if(s.pts===n.pts){a=true;break}if(s.pts>n.pts){t--;continue}if(t===p.length-1){r=i}i--}if(!a&&r===null){return null}var o;if(a){o=i}else{o=r}if(o===0){return e}var l=e.slice(o);var c=l.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});l.byteLength=c.byteLength;l.duration=c.duration;l.nalCount=c.nalCount;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsWith=function(e){p=e}};I.prototype=new ki;k=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if(typeof e.remux!=="undefined"){this.remuxTracks=!!e.remux}else{this.remuxTracks=true}if(typeof e.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;k.prototype.init.call(this);this.push=function(e){if(e.content||e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if(e.track.type==="video"){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if(e.track.type==="audio"){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};k.prototype=new ki;k.prototype.flush=function(e){var t=0,i={captions:[],captionStreams:{},metadata:[],info:{}},s,n,r,a=0,o;if(this.pendingTracks.length<this.numberOfTracks){if(e!=="VideoSegmentStream"&&e!=="AudioSegmentStream"){return}else if(this.remuxTracks){return}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){a=this.videoTrack.timelineStartInfo.pts;Mi.forEach(function(e){i.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){a=this.audioTrack.timelineStartInfo.pts;Ni.forEach(function(e){i.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;r=T.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(o=0;o<this.pendingBoxes.length;o++){i.data.set(this.pendingBoxes[o],t);t+=this.pendingBoxes[o].byteLength}for(o=0;o<this.pendingCaptions.length;o++){s=this.pendingCaptions[o];s.startTime=Di.metadataTsToSeconds(s.startPts,a,this.keepOriginalTimestamps);s.endTime=Di.metadataTsToSeconds(s.endPts,a,this.keepOriginalTimestamps);i.captionStreams[s.stream]=true;i.captions.push(s)}for(o=0;o<this.pendingMetadata.length;o++){n=this.pendingMetadata[o];n.cueTime=Di.metadataTsToSeconds(n.pts,a,this.keepOriginalTimestamps);i.metadata.push(n)}i.metadata.dispatchType=this.metadataStream.dispatchType;this.pendingTracks.length=0;this.videoTrack=null;this.pendingBoxes.length=0;this.pendingCaptions.length=0;this.pendingBytes=0;this.pendingMetadata.length=0;this.trigger("data",i);for(o=0;o<i.captions.length;o++){s=i.captions[o];this.trigger("caption",s)}for(o=0;o<i.metadata.length;o++){n=i.metadata[o];this.trigger("id3Frame",n)}}if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};k.prototype.setRemux=function(e){this.remuxTracks=e};Ui=function(s){var n=this,i=true,r,a;Ui.prototype.init.call(this);s=s||{};this.baseMediaDecodeTime=s.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t;t.type="aac";t.metadataStream=new w.MetadataStream;t.aacStream=new Pi;t.audioTimestampRolloverStream=new w.TimestampRolloverStream("audio");t.timedMetadataTimestampRolloverStream=new w.TimestampRolloverStream("timed-metadata");t.adtsStream=new xi;t.coalesceStream=new k(s,t.metadataStream);t.headOfPipeline=t.aacStream;t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream);t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream);t.metadataStream.on("timestamp",function(e){t.aacStream.setTimestamp(e.timeStamp)});t.aacStream.on("data",function(e){if(e.type!=="timed-metadata"&&e.type!=="audio"||t.audioSegmentStream){return}a=a||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"};t.coalesceStream.numberOfTracks++;t.audioSegmentStream=new C(a,s);t.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream"));t.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo"));t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream);n.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!r})});t.coalesceStream.on("data",this.trigger.bind(this,"data"));t.coalesceStream.on("done",this.trigger.bind(this,"done"));Fi(this,t)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new w.MetadataStream;i.packetStream=new w.TransportPacketStream;i.parseStream=new w.TransportParseStream;i.elementaryStream=new w.ElementaryStream;i.timestampRolloverStream=new w.TimestampRolloverStream;i.adtsStream=new xi;i.h264Stream=new Oi;i.captionStream=new w.CaptionStream(s);i.coalesceStream=new k(s,i.metadataStream);i.headOfPipeline=i.packetStream;i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream);i.timestampRolloverStream.pipe(i.h264Stream);i.timestampRolloverStream.pipe(i.adtsStream);i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream);i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream);i.elementaryStream.on("data",function(e){var t;if(e.type==="metadata"){t=e.tracks.length;while(t--){if(!r&&e.tracks[t].type==="video"){r=e.tracks[t];r.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime}else if(!a&&e.tracks[t].type==="audio"){a=e.tracks[t];a.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime}}if(r&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new I(r,s);i.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",function(e){if(a&&!s.keepOriginalTimestamps){a.timelineStartInfo=e;i.audioSegmentStream.setEarliestDts(e.dts-n.baseMediaDecodeTime)}});i.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(a){i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});i.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(a&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new C(a,s);i.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}n.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!r})}});i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",function(e){e.dispatchType=i.metadataStream.dispatchType;n.trigger("id3Frame",e)});i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Fi(this,i)};this.setBaseMediaDecodeTime=function(e){var t=this.transmuxPipeline_;if(!s.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(a){a.timelineStartInfo.dts=undefined;a.timelineStartInfo.pts=undefined;E.clearDtsInfo(a);if(t.audioTimestampRolloverStream){t.audioTimestampRolloverStream.discontinuity()}}if(r){if(t.videoSegmentStream){t.videoSegmentStream.gopCache_=[]}r.timelineStartInfo.dts=undefined;r.timelineStartInfo.pts=undefined;E.clearDtsInfo(r);t.captionStream.reset()}if(t.timestampRolloverStream){t.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(a){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(e){var t=this.transmuxPipeline_;s.remux=e;if(t&&t.coalesceStream){t.coalesceStream.setRemux(e)}};this.alignGopsWith=function(e){if(r&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.getLogTrigger_=function(t){var i=this;return function(e){e.stream=t;i.trigger("log",e)}};this.push=function(e){if(i){var t=Ri(e);if(t&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!t&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){i=true;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Ui.prototype=new ki;var Vi={Transmuxer:Ui,VideoSegmentStream:I,AudioSegmentStream:C,AUDIO_PROPERTIES:Ni,VIDEO_PROPERTIES:Mi,generateSegmentTimingInfo:ji};var $i=function(e){return e>>>0};var Hi=function(e){return("00"+e.toString(16)).slice(-2)};var Gi={toUnsigned:$i,toHexString:Hi};var zi=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t};var Wi=zi;var Yi=Gi.toUnsigned;var Xi=Wi;var Ki=function(e,t){var i=[],s,n,r,a,o;if(!t.length){return null}for(s=0;s<e.byteLength;){n=Yi(e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]);r=Xi(e.subarray(s+4,s+8));a=n>1?s+n:e.byteLength;if(r===t[0]){if(t.length===1){i.push(e.subarray(s+8,a))}else{o=Ki(e.subarray(s+8,a),t.slice(1));if(o.length){i=i.concat(o)}}}s=a}return i};var Qi=Ki;var Ji=Gi.toUnsigned;var Zi=F.getUint64;var es=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};if(t.version===1){t.baseMediaDecodeTime=Zi(e.subarray(4))}else{t.baseMediaDecodeTime=Ji(e[4]<<24|e[5]<<16|e[6]<<8|e[7])}return t};var ts=es;var is=function(e){return{isLeading:(e[0]&12)>>>2,dependsOn:e[0]&3,isDependedOn:(e[1]&192)>>>6,hasRedundancy:(e[1]&48)>>>4,paddingValue:(e[1]&14)>>>1,isNonSyncSample:e[1]&1,degradationPriority:e[2]<<8|e[3]}};var ss=is;var ns=ss;var rs=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t.flags[2]&1,n=t.flags[2]&4,r=t.flags[1]&1,a=t.flags[1]&2,o=t.flags[1]&4,l=t.flags[1]&8,c=i.getUint32(4),u=8,d;if(s){t.dataOffset=i.getInt32(u);u+=4}if(n&&c){d={flags:ns(e.subarray(u,u+4))};u+=4;if(r){d.duration=i.getUint32(u);u+=4}if(a){d.size=i.getUint32(u);u+=4}if(l){if(t.version===1){d.compositionTimeOffset=i.getInt32(u)}else{d.compositionTimeOffset=i.getUint32(u)}u+=4}t.samples.push(d);c--}while(c--){d={};if(r){d.duration=i.getUint32(u);u+=4}if(a){d.size=i.getUint32(u);u+=4}if(o){d.flags=ns(e.subarray(u,u+4));u+=4}if(l){if(t.version===1){d.compositionTimeOffset=i.getInt32(u)}else{d.compositionTimeOffset=i.getUint32(u)}u+=4}t.samples.push(d)}return t};var as=rs;var os=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},s=i.flags[2]&1,n=i.flags[2]&2,r=i.flags[2]&8,a=i.flags[2]&16,o=i.flags[2]&32,l=i.flags[0]&65536,c=i.flags[0]&131072,u;u=8;if(s){u+=4;i.baseDataOffset=t.getUint32(12);u+=4}if(n){i.sampleDescriptionIndex=t.getUint32(u);u+=4}if(r){i.defaultSampleDuration=t.getUint32(u);u+=4}if(a){i.defaultSampleSize=t.getUint32(u);u+=4}if(o){i.defaultSampleFlags=t.getUint32(u)}if(l){i.durationIsEmpty=true}if(!s&&c){i.baseDataOffsetIsMoof=true}return i};var ls=os;var A;if(typeof Ly!=="undefined"){A=Ly}else if(typeof M!=="undefined"){A=M}else if(typeof self!=="undefined"){A=self}else{A={}}var cs=A;var us=ct.discardEmulationPreventionBytes;var ds=bt.CaptionStream;var hs=Qi;var fs=ts;var ps=as;var ms=ls;var gs=cs;var ys=function(e,t){var i=e;for(var s=0;s<t.length;s++){var n=t[s];if(i<n.size){return n}i-=n.size}return null};var _s=function(e,t,i){var s=new DataView(e.buffer,e.byteOffset,e.byteLength),n={logs:[],seiNals:[]},r,a,o,l;for(a=0;a+4<e.length;a+=o){o=s.getUint32(a);a+=4;if(o<=0){continue}switch(e[a]&31){case 6:var c=e.subarray(a+1,a+1+o);var u=ys(a,t);r={nalUnitType:"sei_rbsp",size:o,data:c,escapedRBSP:us(c),trackId:i};if(u){r.pts=u.pts;r.dts=u.dts;l=u}else if(l){r.pts=l.pts;r.dts=l.dts}else{n.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+a+" for trackId "+i+". See mux.js#223."});break}n.seiNals.push(r);break}}return n};var vs=function(e,t,i){var s=t;var n=i.defaultSampleDuration||0;var r=i.defaultSampleSize||0;var a=i.trackId;var o=[];e.forEach(function(e){var t=ps(e);var i=t.samples;i.forEach(function(e){if(e.duration===undefined){e.duration=n}if(e.size===undefined){e.size=r}e.trackId=a;e.dts=s;if(e.compositionTimeOffset===undefined){e.compositionTimeOffset=0}if(typeof s==="bigint"){e.pts=s+gs.BigInt(e.compositionTimeOffset);s+=gs.BigInt(e.duration)}else{e.pts=s+e.compositionTimeOffset;s+=e.duration}});o=o.concat(i)});return o};var bs=function(e,d){var s=hs(e,["moof","traf"]);var t=hs(e,["mdat"]);var h={};var n=[];t.forEach(function(e,t){var i=s[t];n.push({mdat:e,traf:i})});n.forEach(function(e){var t=e.mdat;var i=e.traf;var s=hs(i,["tfhd"]);var n=ms(s[0]);var r=n.trackId;var a=hs(i,["tfdt"]);var o=a.length>0?fs(a[0]).baseMediaDecodeTime:0;var l=hs(i,["trun"]);var c;var u;if(d===r&&l.length>0){c=vs(l,o,n);u=_s(t,c,r);if(!h[r]){h[r]={seiNals:[],logs:[]}}h[r].seiNals=h[r].seiNals.concat(u.seiNals);h[r].logs=h[r].logs.concat(u.logs)}});return h};var Ts=function(e,t,i){var s;if(t===null){return null}s=bs(e,t);var n=s[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}};var Ss=function(){var t=false;var i;var r;var a;var o;var l;var s;this.isInitialized=function(){return t};this.init=function(e){i=new ds;t=true;s=e?e.isPartial:false;i.on("data",function(e){e.startTime=e.startPts/o;e.endTime=e.endPts/o;l.captions.push(e);l.captionStreams[e.stream]=true});i.on("log",function(e){l.logs.push(e)})};this.isNewInit=function(e,t){if(e&&e.length===0||t&&typeof t==="object"&&Object.keys(t).length===0){return false}return a!==e[0]||o!==t[a]};this.parse=function(e,t,i){var s;if(!this.isInitialized()){return null}else if(!t||!i){return null}else if(this.isNewInit(t,i)){a=t[0];o=i[a]}else if(a===null||!o){r.push(e);return null}while(r.length>0){var n=r.shift();this.parse(n,t,i)}s=Ts(e,a,o);if(s&&s.logs){l.logs=l.logs.concat(s.logs)}if(s===null||!s.seiNals){if(l.logs.length){return{logs:l.logs,captions:[],captionStreams:[]}}return null}this.pushNals(s.seiNals);this.flushStream();return l};this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0){return null}e.forEach(function(e){i.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}if(!s){i.flush()}else{i.partialFlush()}};this.clearParsedCaptions=function(){l.captions=[];l.captionStreams={};l.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}i.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){r=[];a=null;o=null;if(!l){l={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var Es=Ss;var ws=function(e){var t=0;var i=String.fromCharCode(e[t]);var s="";while(i!=="\0"){s+=i;t++;i=String.fromCharCode(e[t])}s+=i;return s};var Is={uint8ToCString:ws};var Cs=Is.uint8ToCString;var ks=F.getUint64;var As=function(e){var t=4;var i=e[0];var s,n,r,a,o,l,c,u;if(i===0){s=Cs(e.subarray(t));t+=s.length;n=Cs(e.subarray(t));t+=n.length;var d=new DataView(e.buffer);r=d.getUint32(t);t+=4;o=d.getUint32(t);t+=4;l=d.getUint32(t);t+=4;c=d.getUint32(t);t+=4}else if(i===1){var d=new DataView(e.buffer);r=d.getUint32(t);t+=4;a=ks(e.subarray(t));t+=8;l=d.getUint32(t);t+=4;c=d.getUint32(t);t+=4;s=Cs(e.subarray(t));t+=s.length;n=Cs(e.subarray(t));t+=n.length}u=new Uint8Array(e.subarray(t,e.byteLength));var h={scheme_id_uri:s,value:n,timescale:r?r:1,presentation_time:a,presentation_time_delta:o,event_duration:l,id:c,message_data:u};return xs(i,h)?h:undefined};var Ds=function(e,t,i,s){return e||e===0?e/t:s+i/t};var xs=function(e,t){var i=t.scheme_id_uri!=="\0";var s=e===0&&Os(t.presentation_time_delta)&&i;var n=e===1&&Os(t.presentation_time)&&i;return!(e>1)&&s||n};var Os=function(e){return e!==undefined||e!==null};var Ps={parseEmsgBox:As,scaleTime:Ds};var Rs=Gi.toUnsigned;var Ls=Gi.toHexString;var D=Qi;var x=Wi;var Ns=Ps;var Ms=ls;var Us=as;var Bs=ts;var Fs=F.getUint64;var qs,js,Vs,$s,Hs,Gs,zs;var Ws=cs;var Ys=Nt.parseId3Frames;qs=function(e){var t={},i=D(e,["moov","trak"]);return i.reduce(function(e,t){var i,s,n,r,a;i=D(t,["tkhd"])[0];if(!i){return null}s=i[0];n=s===0?12:20;r=Rs(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);a=D(t,["mdia","mdhd"])[0];if(!a){return null}s=a[0];n=s===0?12:20;e[r]=Rs(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]);return e},t)};js=function(c,e){var t;t=D(e,["moof","traf"]);var i=t.reduce(function(e,t){var i=D(t,["tfhd"])[0];var s=Rs(i[4]<<24|i[5]<<16|i[6]<<8|i[7]);var n=c[s]||9e4;var r=D(t,["tfdt"])[0];var a=new DataView(r.buffer,r.byteOffset,r.byteLength);var o;if(r[0]===1){o=Fs(r.subarray(4,12))}else{o=a.getUint32(4)}let l;if(typeof o==="bigint"){l=o/Ws.BigInt(n)}else if(typeof o==="number"&&!isNaN(o)){l=o/n}if(l<Number.MAX_SAFE_INTEGER){l=Number(l)}if(l<e){e=l}return e},Infinity);return typeof i==="bigint"||isFinite(i)?i:0};Vs=function(e,t){var i=D(t,["moof","traf"]);var s=0;var n=0;var r;if(i&&i.length){var a=D(i[0],["tfhd"])[0];var o=D(i[0],["trun"])[0];var l=D(i[0],["tfdt"])[0];if(a){var c=Ms(a);r=c.trackId}if(l){var u=Bs(l);s=u.baseMediaDecodeTime}if(o){var d=Us(o);if(d.samples&&d.samples.length){n=d.samples[0].compositionTimeOffset||0}}}var h=e[r]||9e4;if(typeof s==="bigint"){n=Ws.BigInt(n);h=Ws.BigInt(h)}var f=(s+n)/h;if(typeof f==="bigint"&&f<Number.MAX_SAFE_INTEGER){f=Number(f)}return f};$s=function(e){var t=D(e,["moov","trak"]);var l=[];t.forEach(function(e){var t=D(e,["mdia","hdlr"]);var o=D(e,["tkhd"]);t.forEach(function(e,t){var i=x(e.subarray(8,12));var s=o[t];var n;var r;var a;if(i==="vide"){n=new DataView(s.buffer,s.byteOffset,s.byteLength);r=n.getUint8(0);a=r===0?n.getUint32(12):n.getUint32(20);l.push(a)}})});return l};Gs=function(e){var t=e[0];var i=t===0?12:20;return Rs(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])};Hs=function(e){var t=D(e,["moov","trak"]);var f=[];t.forEach(function(e){var t={};var i=D(e,["tkhd"])[0];var s,n;if(i){s=new DataView(i.buffer,i.byteOffset,i.byteLength);n=s.getUint8(0);t.id=n===0?s.getUint32(12):s.getUint32(20)}var r=D(e,["mdia","hdlr"])[0];if(r){var a=x(r.subarray(8,12));if(a==="vide"){t.type="video"}else if(a==="soun"){t.type="audio"}else{t.type=a}}var o=D(e,["mdia","minf","stbl","stsd"])[0];if(o){var l=o.subarray(8);t.codec=x(l.subarray(4,8));var c=D(l,[t.codec])[0];var u,d;if(c){if(/^[asm]vc[1-9]$/i.test(t.codec)){u=c.subarray(78);d=x(u.subarray(4,8));if(d==="avcC"&&u.length>11){t.codec+=".";t.codec+=Ls(u[9]);t.codec+=Ls(u[10]);t.codec+=Ls(u[11])}else{t.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(t.codec)){u=c.subarray(28);d=x(u.subarray(4,8));if(d==="esds"&&u.length>20&&u[19]!==0){t.codec+="."+Ls(u[19]);t.codec+="."+Ls(u[20]>>>2&63).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}else{t.codec=t.codec.toLowerCase()}}}var h=D(e,["mdia","mdhd"])[0];if(h){t.timescale=Gs(h)}f.push(t)});return f};zs=function(e,s=0){var t=D(e,["emsg"]);return t.map(e=>{var t=Ns.parseEmsgBox(new Uint8Array(e));var i=Ys(t.message_data);return{cueTime:Ns.scaleTime(t.presentation_time,t.timescale,t.presentation_time_delta,s),duration:Ns.scaleTime(t.event_duration,t.timescale),frames:i}})};var Xs={findBox:D,parseType:x,timescale:qs,startTime:js,compositionStartTime:Vs,videoTrackIds:$s,tracks:Hs,getTimescaleFromMediaHeader:Gs,getEmsgID3:zs};var Ks=Tt;var Qs=function(e){var t=e[1]&31;t<<=8;t|=e[2];return t};var Js=function(e){return!!(e[1]&64)};var Zs=function(e){var t=0;if((e[3]&48)>>>4>1){t+=e[4]+1}return t};var en=function(e,t){var i=Qs(e);if(i===0){return"pat"}else if(i===t){return"pmt"}else if(t){return"pes"}return null};var tn=function(e){var t=Js(e);var i=4+Zs(e);if(t){i+=e[i]+1}return(e[i+10]&31)<<8|e[i+11]};var sn=function(e){var t={};var i=Js(e);var s=4+Zs(e);if(i){s+=e[s]+1}if(!(e[s+5]&1)){return}var n,r,a;n=(e[s+1]&15)<<8|e[s+2];r=3+n-4;a=(e[s+10]&15)<<8|e[s+11];var o=12+a;while(o<r){var l=s+o;t[(e[l+1]&31)<<8|e[l+2]]=e[l];o+=((e[l+3]&15)<<8|e[l+4])+5}return t};var nn=function(e,t){var i=Qs(e);var s=t[i];switch(s){case Ks.H264_STREAM_TYPE:return"video";case Ks.ADTS_STREAM_TYPE:return"audio";case Ks.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}};var rn=function(e){var t=Js(e);if(!t){return null}var i=4+Zs(e);if(i>=e.byteLength){return null}var s=null;var n;n=e[i+7];if(n&192){s={};s.pts=(e[i+9]&14)<<27|(e[i+10]&255)<<20|(e[i+11]&254)<<12|(e[i+12]&255)<<5|(e[i+13]&254)>>>3;s.pts*=4;s.pts+=(e[i+13]&6)>>>1;s.dts=s.pts;if(n&64){s.dts=(e[i+14]&14)<<27|(e[i+15]&255)<<20|(e[i+16]&254)<<12|(e[i+17]&255)<<5|(e[i+18]&254)>>>3;s.dts*=4;s.dts+=(e[i+18]&6)>>>1}}return s};var an=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}};var on=function(e){var t=4+Zs(e);var i=e.subarray(t);var s=0;var n=0;var r=false;var a;for(;n<i.byteLength-3;n++){if(i[n+2]===1){s=n+5;break}}while(s<i.byteLength){switch(i[s]){case 0:if(i[s-1]!==0){s+=2;break}else if(i[s-2]!==0){s++;break}if(n+3!==s-2){a=an(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}}do{s++}while(i[s]!==1&&s<i.length);n=s-2;s+=3;break;case 1:if(i[s-1]!==0||i[s-2]!==0){s+=3;break}a=an(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}n=s-2;s+=3;break;default:s+=3;break}}i=i.subarray(n);s-=n;n=0;if(i&&i.byteLength>3){a=an(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var ln={parseType:en,parsePat:tn,parsePmt:sn,parsePayloadUnitStartIndicator:Js,parsePesType:nn,parsePesTime:rn,videoPacketContainsKeyFrame:on};var cn=Tt;var O=At.handleRollover;var P={};P.ts=ln;P.aac=_i;var R=r.ONE_SECOND_IN_TS;var L=188,N=71;var un=function(e,t){var i=0,s=L,n,r;while(s<e.byteLength){if(e[i]===N&&e[s]===N){n=e.subarray(i,s);r=P.ts.parseType(n,t.pid);switch(r){case"pat":t.pid=P.ts.parsePat(n);break;case"pmt":var a=P.ts.parsePmt(n);t.table=t.table||{};Object.keys(a).forEach(function(e){t.table[e]=a[e]});break}i+=L;s+=L;continue}i++;s++}};var dn=function(e,t,i){var s=0,n=L,r,a,o,l,c;var u=false;while(n<=e.byteLength){if(e[s]===N&&(e[n]===N||n===e.byteLength)){r=e.subarray(s,n);a=P.ts.parseType(r,t.pid);switch(a){case"pes":o=P.ts.parsePesType(r,t.table);l=P.ts.parsePayloadUnitStartIndicator(r);if(o==="audio"&&l){c=P.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);u=true}}break}if(u){break}s+=L;n+=L;continue}s++;n++}n=e.byteLength;s=n-L;u=false;while(s>=0){if(e[s]===N&&(e[n]===N||n===e.byteLength)){r=e.subarray(s,n);a=P.ts.parseType(r,t.pid);switch(a){case"pes":o=P.ts.parsePesType(r,t.table);l=P.ts.parsePayloadUnitStartIndicator(r);if(o==="audio"&&l){c=P.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);u=true}}break}if(u){break}s-=L;n-=L;continue}s--;n--}};var hn=function(e,t,i){var s=0,n=L,r,a,o,l,c,u,d,h;var f=false;var p={data:[],size:0};while(n<e.byteLength){if(e[s]===N&&e[n]===N){r=e.subarray(s,n);a=P.ts.parseType(r,t.pid);switch(a){case"pes":o=P.ts.parsePesType(r,t.table);l=P.ts.parsePayloadUnitStartIndicator(r);if(o==="video"){if(l&&!f){c=P.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);f=true}}if(!i.firstKeyFrame){if(l){if(p.size!==0){u=new Uint8Array(p.size);d=0;while(p.data.length){h=p.data.shift();u.set(h,d);d+=h.byteLength}if(P.ts.videoPacketContainsKeyFrame(u)){var m=P.ts.parsePesTime(u);if(m){i.firstKeyFrame=m;i.firstKeyFrame.type="video"}else{console.warn("Failed to extract PTS/DTS from PES at first keyframe. "+"This could be an unusual TS segment, or else mux.js did not "+"parse your TS segment correctly. If you know your TS "+"segments do contain PTS/DTS on keyframes please file a bug "+"report! You can try ffprobe to double check for yourself.")}}p.size=0}}p.data.push(r);p.size+=r.byteLength}}break}if(f&&i.firstKeyFrame){break}s+=L;n+=L;continue}s++;n++}n=e.byteLength;s=n-L;f=false;while(s>=0){if(e[s]===N&&e[n]===N){r=e.subarray(s,n);a=P.ts.parseType(r,t.pid);switch(a){case"pes":o=P.ts.parsePesType(r,t.table);l=P.ts.parsePayloadUnitStartIndicator(r);if(o==="video"&&l){c=P.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);f=true}}break}if(f){break}s-=L;n-=L;continue}s--;n--}};var fn=function(e,t){if(e.audio&&e.audio.length){var i=t;if(typeof i==="undefined"||isNaN(i)){i=e.audio[0].dts}e.audio.forEach(function(e){e.dts=O(e.dts,i);e.pts=O(e.pts,i);e.dtsTime=e.dts/R;e.ptsTime=e.pts/R})}if(e.video&&e.video.length){var s=t;if(typeof s==="undefined"||isNaN(s)){s=e.video[0].dts}e.video.forEach(function(e){e.dts=O(e.dts,s);e.pts=O(e.pts,s);e.dtsTime=e.dts/R;e.ptsTime=e.pts/R});if(e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=O(n.dts,s);n.pts=O(n.pts,s);n.dtsTime=n.dts/R;n.ptsTime=n.pts/R}}};var pn=function(e){var t=false,i=0,s=null,n=null,r=0,a=0,o;while(e.length-a>=3){var l=P.aac.parseType(e,a);switch(l){case"timed-metadata":if(e.length-a<10){t=true;break}r=P.aac.parseId3TagSize(e,a);if(r>e.length){t=true;break}if(n===null){o=e.subarray(a,a+r);n=P.aac.parseAacTimestamp(o)}a+=r;break;case"audio":if(e.length-a<7){t=true;break}r=P.aac.parseAdtsSize(e,a);if(r>e.length){t=true;break}if(s===null){o=e.subarray(a,a+r);s=P.aac.parseSampleRate(o)}i++;a+=r;break;default:a++;break}if(t){return null}}if(s===null||n===null){return null}var c=R/s;var u={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+i*1024*c,pts:n+i*1024*c}]};return u};var mn=function(e){var t={pid:null,table:null};var i={};un(e,t);for(var s in t.table){if(t.table.hasOwnProperty(s)){var n=t.table[s];switch(n){case cn.H264_STREAM_TYPE:i.video=[];hn(e,t,i);if(i.video.length===0){delete i.video}break;case cn.ADTS_STREAM_TYPE:i.audio=[];dn(e,t,i);if(i.audio.length===0){delete i.audio}break}}}return i};var gn=function(e,t){var i=P.aac.isLikelyAacData(e);var s;if(i){s=pn(e)}else{s=mn(e)}if(!s||!s.audio&&!s.video){return null}fn(s,t);return s};var yn={inspect:gn,parseAudioPes_:dn};const _n=function(s,e){e.on("data",function(e){const t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength};const i=e.data;e.data=i.buffer;s.postMessage({action:"data",segment:e,byteOffset:i.byteOffset,byteLength:i.byteLength},[e.data])});e.on("done",function(e){s.postMessage({action:"done"})});e.on("gopInfo",function(e){s.postMessage({action:"gopInfo",gopInfo:e})});e.on("videoSegmentTimingInfo",function(e){const t={start:{decode:r.videoTsToSeconds(e.start.dts),presentation:r.videoTsToSeconds(e.start.pts)},end:{decode:r.videoTsToSeconds(e.end.dts),presentation:r.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:r.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){t.prependedContentDuration=r.videoTsToSeconds(e.prependedContentDuration)}s.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})});e.on("audioSegmentTimingInfo",function(e){const t={start:{decode:r.videoTsToSeconds(e.start.dts),presentation:r.videoTsToSeconds(e.start.pts)},end:{decode:r.videoTsToSeconds(e.end.dts),presentation:r.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:r.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){t.prependedContentDuration=r.videoTsToSeconds(e.prependedContentDuration)}s.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:t})});e.on("id3Frame",function(e){s.postMessage({action:"id3Frame",id3Frame:e})});e.on("caption",function(e){s.postMessage({action:"caption",caption:e})});e.on("trackinfo",function(e){s.postMessage({action:"trackinfo",trackInfo:e})});e.on("audioTimingInfo",function(e){s.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:r.videoTsToSeconds(e.start),end:r.videoTsToSeconds(e.end)}})});e.on("videoTimingInfo",function(e){s.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:r.videoTsToSeconds(e.start),end:r.videoTsToSeconds(e.end)}})});e.on("log",function(e){s.postMessage({action:"log",log:e})})};class vn{constructor(e,t){this.options=t||{};this.self=e;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Vi.Transmuxer(this.options);_n(this.self,this.transmuxer)}pushMp4Captions(e){if(!this.captionParser){this.captionParser=new Es;this.captionParser.init()}const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);const i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Xs.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Xs.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Xs.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i=typeof t==="number"&&!isNaN(t)?t*r.ONE_SECOND_IN_TS:void 0;const s=yn.inspect(e,i);let n=null;if(s){n={hasVideo:s.video&&s.video.length===2||false,hasAudio:s.audio&&s.audio.length===2||false};if(n.hasVideo){n.videoStart=s.video[0].ptsTime}if(n.hasAudio){n.audioStart=s.audio[0].ptsTime}}this.self.postMessage({action:"probeTs",result:n,data:e},[e.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(r.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(r.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if(e.data.action==="init"&&e.data.options){this.messageHandlers=new vn(self,e.data.options);return}if(!this.messageHandlers){this.messageHandlers=new vn(self)}if(e.data&&e.data.action&&e.data.action!=="init"){if(this.messageHandlers[e.data.action]){this.messageHandlers[e.data.action](e.data)}}}}));var wp=bp(Ep);const Ip=(e,t,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:c}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data};const d={type:s,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};if(typeof l!=="undefined"){d.videoFrameDtsTime=l}if(typeof c!=="undefined"){d.videoFramePtsTime=c}i(d)};const Cp=({transmuxedData:e,callback:t})=>{e.buffer=[];t(e)};const kp=(e,t)=>{t.gopInfo=e.data.gopInfo};const Ap=t=>{const{transmuxer:i,bytes:e,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:c,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:d,onId3:h,onCaptions:f,onDone:p,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y,segment:_,triggerSegmentEventFn:v}=t;const b={buffer:[]};let T=y;const S=e=>{if(i.currentTransmux!==t){return}if(e.data.action==="data"){Ip(e,b,a)}if(e.data.action==="trackinfo"){o(e.data.trackInfo)}if(e.data.action==="gopInfo"){kp(e,b)}if(e.data.action==="audioTimingInfo"){l(e.data.audioTimingInfo)}if(e.data.action==="videoTimingInfo"){c(e.data.videoTimingInfo)}if(e.data.action==="videoSegmentTimingInfo"){u(e.data.videoSegmentTimingInfo)}if(e.data.action==="audioSegmentTimingInfo"){d(e.data.audioSegmentTimingInfo)}if(e.data.action==="id3Frame"){h([e.data.id3Frame],e.data.id3Frame.dispatchType)}if(e.data.action==="caption"){f(e.data.caption)}if(e.data.action==="endedtimeline"){T=false;m()}if(e.data.action==="log"){g(e.data.log)}if(e.data.type!=="transmuxed"){return}if(T){return}i.onmessage=null;Cp({transmuxedData:b,callback:p});Dp(i)};const E=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:C.Error.StreamingFailedToTransmuxSegment,segmentInfo:Zm({segment:_})}};p(null,e)};i.onmessage=S;i.onerror=E;if(s){i.postMessage({action:"setAudioAppendStart",appendStart:s})}if(Array.isArray(n)){i.postMessage({action:"alignGopsWith",gopsToAlignWith:n})}if(typeof r!=="undefined"){i.postMessage({action:"setRemux",remux:r})}if(e.byteLength){const w=e instanceof ArrayBuffer?e:e.buffer;const I=e instanceof ArrayBuffer?0:e.byteOffset;v({type:"segmenttransmuxingstart",segment:_});i.postMessage({action:"push",data:w,byteOffset:I,byteLength:e.byteLength},[w])}if(y){i.postMessage({action:"endTimeline"})}i.postMessage({action:"flush"})};const Dp=e=>{e.currentTransmux=null;if(e.transmuxQueue.length){e.currentTransmux=e.transmuxQueue.shift();if(typeof e.currentTransmux==="function"){e.currentTransmux()}else{Ap(e.currentTransmux)}}};const xp=(e,t)=>{e.postMessage({action:t});Dp(e)};const Op=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e;xp(t,e);return}t.transmuxQueue.push(xp.bind(null,t,e))};const Pp=e=>{Op("reset",e)};const Rp=e=>{Op("endTimeline",e)};const Lp=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e;Ap(e);return}e.transmuxer.transmuxQueue.push(e)};const Np=e=>{const t=new wp;t.currentTransmux=null;t.transmuxQueue=[];const i=t.terminate;t.terminate=()=>{t.currentTransmux=null;t.transmuxQueue.length=0;return i.call(t)};t.postMessage({action:"init",options:e});return t};var Mp={reset:Pp,endTimeline:Rp,transmux:Lp,createTransmuxer:Np};const Up=function(t){const i=t.transmuxer;const s=t.endAction||t.action;const n=t.callback;const e=y({},t,{endAction:null,transmuxer:null,callback:null});const r=e=>{if(e.data.action!==s){return}i.removeEventListener("message",r);if(e.data.data){e.data.data=new Uint8Array(e.data.data,t.byteOffset||0,t.byteLength||e.data.data.byteLength);if(t.data){t.data=e.data.data}}n(e.data)};i.addEventListener("message",r);if(t.data){const a=t.data instanceof ArrayBuffer;e.byteOffset=a?0:t.data.byteOffset;e.byteLength=t.data.byteLength;const o=[a?t.data:t.data.buffer];i.postMessage(e,o)}else{i.postMessage(e)}};const Bp={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const Fp=e=>{e.forEach(e=>{e.abort()})};const qp=e=>{return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}};const jp=e=>{const t=e.target;const i=Date.now()-t.requestTime;const s={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};s.bytesReceived=e.loaded;s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3);return s};const Vp=(e,t)=>{const{requestType:i}=t;const s=Sf({requestType:i,request:t,error:e});if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Bp.TIMEOUT,xhr:t,metadata:s}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Bp.ABORTED,xhr:t,metadata:s}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Bp.FAILURE,xhr:t,metadata:s}}if(t.responseType==="arraybuffer"&&t.response.byteLength===0){return{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Bp.FAILURE,xhr:t,metadata:s}}return null};const $p=(o,l,c,u)=>(e,t)=>{const i=t.response;const s=Vp(e,t);if(s){return c(s,o)}if(i.byteLength!==16){return c({status:t.status,message:"Invalid HLS key at URL: "+t.uri,code:Bp.FAILURE,xhr:t},o)}const n=new DataView(i);const r=new Uint32Array([n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12)]);for(let e=0;e<l.length;e++){l[e].bytes=r}const a={uri:t.uri};u({type:"segmentkeyloadcomplete",segment:o,keyInfo:a});return c(null,o)};const Hp=(i,s)=>{const e=ch(i.map.bytes);if(e!=="mp4"){const t=i.map.resolvedUri||i.map.uri;const n=e||"unknown";return s({internal:true,message:`Found unsupported ${n} container for initialization segment at URL: ${t}`,code:Bp.FAILURE,metadata:{mediaType:n}})}Up({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:e,data:t})=>{i.map.bytes=t;e.forEach(function(e){i.map.tracks=i.map.tracks||{};if(i.map.tracks[e.type]){return}i.map.tracks[e.type]=e;if(typeof e.id==="number"&&e.timescale){i.map.timescales=i.map.timescales||{};i.map.timescales[e.id]=e.timescale}});return s(null)}})};const Gp=({segment:n,finishProcessingFn:r,triggerSegmentEventFn:a})=>(e,t)=>{const i=Vp(e,t);if(i){return r(i,n)}const s=new Uint8Array(t.response);a({type:"segmentloaded",segment:n});if(n.map.key){n.map.encryptedBytes=s;return r(null,n)}n.map.bytes=s;Hp(n,function(e){if(e){e.xhr=t;e.status=t.status;return r(e,n)}r(null,n)})};const zp=({segment:n,finishProcessingFn:r,responseType:a,triggerSegmentEventFn:o})=>(e,t)=>{const i=Vp(e,t);if(i){return r(i,n)}o({type:"segmentloaded",segment:n});const s=a==="arraybuffer"||!t.responseText?t.response:yp(t.responseText.substring(n.lastReachedChar||0));n.stats=qp(t);if(n.key){n.encryptedBytes=new Uint8Array(s)}else{n.bytes=new Uint8Array(s)}return r(null,n)};const Wp=({segment:i,bytes:s,trackInfoFn:n,timingInfoFn:e,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:t,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:f})=>{const p=i.map&&i.map.tracks||{};const m=Boolean(p.audio&&p.video);let g=e.bind(null,i,"audio","start");const y=e.bind(null,i,"audio","end");let _=e.bind(null,i,"video","start");const v=e.bind(null,i,"video","end");const b=()=>Lp({bytes:s,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:m,onData:e=>{e.type=e.type==="combined"?"video":e.type;u(i,e)},onTrackInfo:e=>{if(n){if(m){e.isMuxed=true}n(i,e)}},onAudioTimingInfo:e=>{if(g&&typeof e.start!=="undefined"){g(e.start);g=null}if(y&&typeof e.end!=="undefined"){y(e.end)}},onVideoTimingInfo:e=>{if(_&&typeof e.start!=="undefined"){_(e.start);_=null}if(v&&typeof e.end!=="undefined"){v(e.end)}},onVideoSegmentTimingInfo:e=>{const t={pts:{start:e.start.presentation,end:e.end.presentation},dts:{start:e.start.decode,end:e.end.decode}};f({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:t});r(e)},onAudioSegmentTimingInfo:e=>{const t={pts:{start:e.start.pts,end:e.end.pts},dts:{start:e.start.dts,end:e.end.dts}};f({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:t});a(e)},onId3:(e,t)=>{o(i,e,t)},onCaptions:e=>{t(i,[e])},isEndOfTimeline:l,onEndedTimeline:()=>{c()},onTransmuxerLog:h,onDone:(e,t)=>{if(!d){return}e.type=e.type==="combined"?"video":e.type;f({type:"segmenttransmuxingcomplete",segment:i});d(t,i,e)},segment:i,triggerSegmentEventFn:f});Up({action:"probeTs",transmuxer:i.transmuxer,data:s,baseStartTime:i.baseStartTime,callback:e=>{i.bytes=s=e.data;const t=e.result;if(t){n(i,{hasAudio:t.hasAudio,hasVideo:t.hasVideo,isMuxed:m});n=null}b()}})};const Yp=({segment:i,bytes:s,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:t,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:f})=>{let p=new Uint8Array(s);if(uh(p)){i.isFmp4=true;const{tracks:m}=i.map;const g={isFmp4:true,hasVideo:!!m.video,hasAudio:!!m.audio};if(m.audio&&m.audio.codec&&m.audio.codec!=="enca"){g.audioCodec=m.audio.codec}if(m.video&&m.video.codec&&m.video.codec!=="encv"){g.videoCodec=m.video.codec}if(m.video&&m.audio){g.isMuxed=true}e(i,g);const y=(e,t)=>{u(i,{data:p,type:g.hasAudio&&!g.isMuxed?"audio":"video"});if(t&&t.length){a(i,t)}if(e&&e.length){o(i,e)}d(null,i,{})};Up({action:"probeMp4StartTime",timescales:i.map.timescales,data:p,transmuxer:i.transmuxer,callback:({data:e,startTime:t})=>{s=e.buffer;i.bytes=p=e;if(g.hasAudio&&!g.isMuxed){n(i,"audio","start",t)}if(g.hasVideo){n(i,"video","start",t)}Up({action:"probeEmsgID3",data:p,transmuxer:i.transmuxer,offset:t,callback:({emsgData:e,id3Frames:t})=>{s=e.buffer;i.bytes=p=e;if(!m.video||!e.byteLength||!i.transmuxer){y(undefined,t);return}Up({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:p,timescales:i.map.timescales,trackIds:[m.video.id],callback:e=>{s=e.data.buffer;i.bytes=p=e.data;e.logs.forEach(function(e){h(M(e,{stream:"mp4CaptionParser"}))});y(e.captions,t)}})}})}});return}if(!i.transmuxer){d(null,i,{});return}if(typeof i.container==="undefined"){i.container=ch(p)}if(i.container!=="ts"&&i.container!=="aac"){e(i,{hasAudio:false,hasVideo:false});d(null,i,{});return}Wp({segment:i,bytes:s,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:t,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:f})};const Xp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:n,doneFn:r},a){const o=e=>{if(e.data.source===i){s.removeEventListener("message",o);const t=e.data.decrypted;a(new Uint8Array(t.bytes,t.byteOffset,t.byteLength))}};s.onerror=()=>{const e="An error occurred in the decryption worker";const t=Zm({segment:n});const i={message:e,metadata:{error:new Error(e),errorType:C.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}};r(i,n)};s.addEventListener("message",o);let l;if(e.bytes.slice){l=e.bytes.slice()}else{l=new Uint32Array(Array.prototype.slice.call(e.bytes))}s.postMessage($f({source:i,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])};const Kp=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:f})=>{f({type:"segmentdecryptionstart"});Xp({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:d},e=>{t.bytes=e;f({type:"segmentdecryptioncomplete",segment:t});Yp({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:f})})};const Qp=({activeXhrs:s,decryptionWorker:n,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m,triggerSegmentEventFn:g})=>{let y=0;let _=false;return(e,t)=>{if(_){return}if(e){_=true;Fp(s);return p(e,t)}y+=1;if(y===s.length){const i=function(){if(t.encryptedBytes){return Kp({decryptionWorker:n,segment:t,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m,triggerSegmentEventFn:g})}Yp({segment:t,bytes:t.bytes,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m,triggerSegmentEventFn:g})};t.endOfAllRequests=Date.now();if(t.map&&t.map.encryptedBytes&&!t.map.bytes){g({type:"segmentdecryptionstart",segment:t});return Xp({decryptionWorker:n,id:t.requestId+"-init",encryptedBytes:t.map.encryptedBytes,key:t.map.key,segment:t,doneFn:p},e=>{t.map.bytes=e;g({type:"segmentdecryptioncomplete",segment:t});Hp(t,e=>{if(e){Fp(s);return p(e,t)}i()})})}i()}}};const Jp=({loadendState:i,abortFn:s})=>e=>{const t=e.target;if(t.aborted&&s&&!i.calledAbortFn){s();i.calledAbortFn=true}};const Zp=({segment:i,progressFn:s,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u})=>e=>{const t=e.target;if(t.aborted){return}i.stats=M(i.stats,jp(e));if(!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived){i.stats.firstBytesReceivedAt=Date.now()}return s(e,i)};const em=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y})=>{const _=[];const v=Qp({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y});if(s.key&&!s.key.bytes){const w=[s.key];if(s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri){w.push(s.map.key)}const I=M(t,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"});const C=$p(s,w,v,y);const k={uri:s.key.resolvedUri};y({type:"segmentkeyloadstart",segment:s,keyInfo:k});const A=e(I,C);_.push(A)}if(s.map&&!s.map.bytes){const D=s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri);if(D){const R=M(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"});const L=$p(s,[s.map.key],v,y);const k={uri:s.map.key.resolvedUri};y({type:"segmentkeyloadstart",segment:s,keyInfo:k});const N=e(R,L);_.push(N)}const x=M(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Ff(s.map),requestType:"segment-media-initialization"});const O=Gp({segment:s,finishProcessingFn:v,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:s});const P=e(x,O);_.push(P)}const b=M(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Ff(s),requestType:"segment"});const T=zp({segment:s,finishProcessingFn:v,responseType:b.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:s});const S=e(b,T);S.addEventListener("progress",Zp({segment:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p}));_.push(S);const E={};_.forEach(e=>{e.addEventListener("loadend",Jp({loadendState:E,abortFn:n}))});return()=>Fp(_)};const tm=Eh("CodecUtils");const im=function(e){const t=e.attributes||{};if(t.CODECS){return mo(t.CODECS)}};const sm=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]};const nm=(e,t)=>{if(!sm(e,t)){return true}const i=t.attributes||{};const s=e.mediaGroups.AUDIO[i.AUDIO];for(const n in s){if(!s[n].uri&&!s[n].playlists){return true}}return false};const rm=function(e){const s={};e.forEach(({mediaType:e,type:t,details:i})=>{s[e]=s[e]||[];s[e].push(po(`${t}${i}`))});Object.keys(s).forEach(function(e){if(s[e].length>1){tm(`multiple ${e} codecs found as attributes: ${s[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);s[e]=null;return}s[e]=s[e][0]});return s};const am=function(e){let t=0;if(e.audio){t++}if(e.video){t++}return t};const om=function(e,t){const i=t.attributes||{};const s=rm(im(t)||[]);if(sm(e,t)&&!s.audio){if(!nm(e,t)){const n=rm(go(e,i.AUDIO)||[]);if(n.audio){s.audio=n.audio}}}return s};const lm=Eh("PlaylistSelector");const cm=function(e){if(!e||!e.playlist){return}const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})};const um=function(e,t){if(!e){return""}const i=Ly.getComputedStyle(e);if(!i){return""}return i[t]};const dm=function(e,s){const n=e.slice();e.sort(function(e,t){const i=s(e,t);if(i===0){return n.indexOf(e)-n.indexOf(t)}return i})};const hm=function(e,t){let i;let s;if(e.attributes.BANDWIDTH){i=e.attributes.BANDWIDTH}i=i||Ly.Number.MAX_VALUE;if(t.attributes.BANDWIDTH){s=t.attributes.BANDWIDTH}s=s||Ly.Number.MAX_VALUE;return i-s};const fm=function(e,t){let i;let s;if(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width){i=e.attributes.RESOLUTION.width}i=i||Ly.Number.MAX_VALUE;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){s=t.attributes.RESOLUTION.width}s=s||Ly.Number.MAX_VALUE;if(i===s&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH){return e.attributes.BANDWIDTH-t.attributes.BANDWIDTH}return i-s};let pm=function(e,t,i,s,n,r){if(!e){return}const a={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:n};let o=e.playlists;if(cf.isAudioOnly(e)){o=r.getAudioTrackPlaylists_();a.audioOnly=true}let l=o.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width;const s=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;t=e.attributes&&e.attributes.BANDWIDTH;t=t||Ly.Number.MAX_VALUE;return{bandwidth:t,width:i,height:s,playlist:e}});dm(l,(e,t)=>e.bandwidth-t.bandwidth);l=l.filter(e=>!cf.isIncompatible(e.playlist));let c=l.filter(e=>cf.isEnabled(e.playlist));if(!c.length){c=l.filter(e=>!cf.isDisabled(e.playlist))}const u=c.filter(e=>e.bandwidth*L.BANDWIDTH_VARIANCE<t);let d=u[u.length-1];const h=u.filter(e=>e.bandwidth===d.bandwidth)[0];if(n===false){const b=h||c[0]||l[0];if(b&&b.playlist){let e="sortedPlaylistReps";if(h){e="bandwidthBestRep"}if(c[0]){e="enabledPlaylistReps"}lm(`choosing ${cm(b)} using ${e} with options`,a);return b.playlist}lm("could not choose a playlist with options",a);return null}const f=u.filter(e=>e.width&&e.height);dm(f,(e,t)=>e.width-t.width);const p=f.filter(e=>e.width===i&&e.height===s);d=p[p.length-1];const m=p.filter(e=>e.bandwidth===d.bandwidth)[0];let g;let y;let _;if(!m){g=f.filter(e=>e.width>i||e.height>s);y=g.filter(e=>e.width===g[0].width&&e.height===g[0].height);d=y[y.length-1];_=y.filter(e=>e.bandwidth===d.bandwidth)[0]}let v;if(r.leastPixelDiffSelector){const T=f.map(e=>{e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-s);return e});dm(T,(e,t)=>{if(e.pixelDiff===t.pixelDiff){return t.bandwidth-e.bandwidth}return e.pixelDiff-t.pixelDiff});v=T[0]}const b=v||_||m||h||c[0]||l[0];if(b&&b.playlist){let e="sortedPlaylistReps";if(v){e="leastPixelDiffRep"}else if(_){e="resolutionPlusOneRep"}else if(m){e="resolutionBestRep"}else if(h){e="bandwidthBestRep"}else if(c[0]){e="enabledPlaylistReps"}lm(`choosing ${cm(b)} using ${e} with options`,a);return b.playlist}lm("could not choose a playlist with options",a);return null};const mm=function(){let e=this.useDevicePixelRatio?Ly.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio)){e=this.customPixelRatio}return pm(this.playlists.main,this.systemBandwidth,parseInt(um(this.tech_.el(),"width"),10)*e,parseInt(um(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};const gm=function(t){let i=-1;let s=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){let e=this.useDevicePixelRatio?Ly.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio)){e=this.customPixelRatio}if(i<0){i=this.systemBandwidth;s=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==s){i=t*this.systemBandwidth+(1-t)*i;s=this.systemBandwidth}return pm(this.playlists.main,i,parseInt(um(this.tech_.el(),"width"),10)*e,parseInt(um(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const ym=function(e){const{main:t,currentTime:r,bandwidth:a,duration:o,segmentDuration:l,timeUntilRebuffer:c,currentTimeline:u,syncController:d}=e;const i=t.playlists.filter(e=>!cf.isIncompatible(e));let s=i.filter(cf.isEnabled);if(!s.length){s=i.filter(e=>!cf.isDisabled(e))}const n=s.filter(cf.hasAttribute.bind(null,"BANDWIDTH"));const h=n.map(e=>{const t=d.getSyncPoint(e,o,u,r);const i=t?1:2;const s=cf.estimateSegmentRequestTime(l,a,e);const n=s*i-c;return{playlist:e,rebufferingImpact:n}});const f=h.filter(e=>e.rebufferingImpact<=0);dm(f,(e,t)=>hm(t.playlist,e.playlist));if(f.length){return f[0]}dm(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact);return h[0]||null};const _m=function(){const e=this.playlists.main.playlists.filter(cf.isEnabled);dm(e,(e,t)=>hm(e,t));const t=e.filter(e=>!!om(this.playlists.main,e).video);return t[0]||null};const vm=e=>{let t=0;let i;if(e.bytes){i=new Uint8Array(e.bytes);e.segments.forEach(e=>{i.set(e,t);t+=e.byteLength})}return i};function bm(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const Tm=function(n,r,a){if(!n[a]){r.trigger({type:"usage",name:"vhs-608"});let s=a;if(/^cc708_/.test(a)){s="SERVICE"+a.split("_")[1]}const e=r.textTracks().getTrackById(s);if(e){n[a]=e}else{const o=r.options_.vhs&&r.options_.vhs.captionServices||{};let e=a;let t=a;let i=false;const l=o[s];if(l){e=l.label;t=l.language;i=l.default}n[a]=r.addRemoteTextTrack({kind:"captions",id:s,default:i,label:e,language:t},false).track}}};const Sm=function({inbandTextTracks:n,captionArray:e,timestampOffset:r}){if(!e){return}const a=Ly.WebKitDataCue||Ly.VTTCue;e.forEach(i=>{const s=i.stream;if(i.content){i.content.forEach(e=>{const t=new a(i.startTime+r,i.endTime+r,e.text);t.line=e.line;t.align="left";t.position=e.position;t.positionAlign="line-left";n[s].addCue(t)})}else{n[s].addCue(new a(i.startTime+r,i.endTime+r,i.text))}})};const Em=function(e){Object.defineProperties(e.frame,{id:{get(){C.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get(){C.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get(){C.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})};const wm=({inbandTextTracks:e,metadataArray:t,timestampOffset:s,videoDuration:r})=>{if(!t){return}const n=Ly.WebKitDataCue||Ly.VTTCue;const a=e.metadataTrack_;if(!a){return}t.forEach(e=>{const i=e.cueTime+s;if(typeof i!=="number"||Ly.isNaN(i)||i<0||!(i<Infinity)){return}if(!e.frames||!e.frames.length){return}e.frames.forEach(e=>{const t=new n(i,i,e.value||e.url||e.data||"");t.frame=e;t.value=e;Em(t);a.addCue(t)})});if(!a.cues||!a.cues.length){return}const i=a.cues;const o=[];for(let e=0;e<i.length;e++){if(i[e]){o.push(i[e])}}const l=o.reduce((e,t)=>{const i=e[t.startTime]||[];i.push(t);e[t.startTime]=i;return e},{});const c=Object.keys(l).sort((e,t)=>Number(e)-Number(t));c.forEach((e,t)=>{const i=l[e];const s=isFinite(r)?r:e;const n=Number(c[t+1])||s;i.forEach(e=>{e.endTime=n})})};const Im={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"};const Cm=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]);const km=({inbandTextTracks:e,dateRanges:t})=>{const s=e.metadataTrack_;if(!s){return}const n=Ly.WebKitDataCue||Ly.VTTCue;t.forEach(e=>{for(const t of Object.keys(e)){if(Cm.has(t)){continue}const i=new n(e.startTime,e.endTime,"");i.id=e.id;i.type="com.apple.quicktime.HLS";i.value={key:Im[t],data:e[t]};if(t==="scte35Out"||t==="scte35In"){i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer}s.addCue(i)}e.processDateRange()})};const Am=(e,t,i)=>{if(e.metadataTrack_){return}e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;if(!C.browser.IS_ANY_SAFARI){e.metadataTrack_.inBandMetadataTrackDispatchType=t}};const Dm=function(e,t,i){let s;let n;if(!i){return}if(!i.cues){return}s=i.cues.length;while(s--){n=i.cues[s];if(n.startTime>=e&&n.endTime<=t){i.removeCue(n)}}};const xm=function(t){const i=t.cues;if(!i){return}const s={};for(let e=i.length-1;e>=0;e--){const n=i[e];const r=`${n.startTime}-${n.endTime}-${n.text}`;if(s[r]){t.removeCue(n)}else{s[r]=n}}};const Om=(e,t,i)=>{if(typeof t==="undefined"||t===null||!e.length){return[]}const s=Math.ceil((t-i+3)*bh);let n;for(n=0;n<e.length;n++){if(e[n].pts>s){break}}return e.slice(n)};const Pm=(e,t,i)=>{if(!t.length){return e}if(i){return t.slice()}const s=t[0].pts;let n=0;for(n;n<e.length;n++){if(e[n].pts>=s){break}}return e.slice(0,n).concat(t)};const Rm=(e,t,i,s)=>{const n=Math.ceil((t-s)*bh);const r=Math.ceil((i-s)*bh);const a=e.slice();let o=e.length;while(o--){if(e[o].pts<=r){break}}if(o===-1){return a}let l=o+1;while(l--){if(e[l].pts<=n){break}}l=Math.max(l,0);a.splice(l,o-l+1);return a};const Lm=function(t,i){if(!t&&!i||!t&&i||t&&!i){return false}if(t===i){return true}const s=Object.keys(t).sort();const n=Object.keys(i).sort();if(s.length!==n.length){return false}for(let e=0;e<s.length;e++){const r=s[e];if(r!==n[e]){return false}if(t[r]!==i[r]){return false}}return true};const Nm=function(t,i,s){i=i||[];const n=[];let r=0;for(let e=0;e<i.length;e++){const a=i[e];if(t===a.timeline){n.push(e);r+=a.duration;if(r>s){return e}}}if(n.length===0){return 0}return n[n.length-1]};const Mm=1;const Um=500;const Bm=e=>typeof e==="number"&&isFinite(e);const Fm=1/60;const qm=(e,t,i)=>{if(e!=="main"||!t||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(t.hasVideo&&!i.hasVideo){return"Only audio found in segment when we expected video."+" We can't switch to audio only from a stream that had video."+" To get rid of this message, please add codec information to the manifest."}if(!t.hasVideo&&i.hasVideo){return"Video found in segment when we expected only audio."+" We can't switch to a stream with video from an audio only stream."+" To get rid of this message, please add codec information to the manifest."}return null};const jm=(e,t,i)=>{let s=t-L.BACK_BUFFER_LENGTH;if(e.length){s=Math.max(s,e.start(0))}const n=t-i;return Math.min(n,s)};const Vm=e=>{const{startOfSegment:t,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:c,timeline:u}=e;const d=o.length-1;let h="mediaIndex/partIndex increment";if(e.getMediaInfoForTime){h=`getMediaInfoForTime (${e.getMediaInfoForTime})`}else if(e.isSyncRequest){h="getSyncSegmentCandidate (isSyncRequest)"}if(e.independent){h+=` with independent ${e.independent}`}const f=typeof c==="number";const p=e.segment.uri?"segment":"pre-segment";const m=f?jh({preloadSegment:s})-1:0;return`${p} [${r+l}/${r+d}]`+(f?` part [${c}/${m}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(f?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${h}]`+` playlist [${a}]`};const $m=e=>`${e}TimingInfo`;const Hm=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:n})=>{if(!n&&e===t){return null}if(e<t){return i}return s.length?s.end(s.length-1):i};const Gm=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(t===i){return false}if(s==="audio"){const r=e.lastTimelineChange({type:"main"});return!r||r.to!==i}if(s==="main"&&n){const a=e.pendingTimelineChange({type:"audio"});if(a&&a.to===i){return false}return true}return false};const zm=e=>{if(!e){return false}const t=e.pendingTimelineChange({type:"audio"});const i=e.pendingTimelineChange({type:"main"});const s=t&&i;const n=s&&t.to!==i.to;const r=s&&t.from!==-1&&i.from!==-1;if(r&&n){return true}return false};const Wm=e=>{if(!e){return}e.pause();e.resetEverything();e.load()};const Ym=e=>{const t=e.timelineChangeController_.pendingTimelineChange({type:"audio"});const i=e.timelineChangeController_.pendingTimelineChange({type:"main"});const s=t&&i;return s&&t.to<i.to};const Xm=e=>{const t=e.pendingSegment_;if(!t){return}const i=Gm({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_});if(i&&zm(e.timelineChangeController_)){if(e.sourceType_==="dash"&&Ym(e)){e.timelineChangeController_.trigger("audioTimelineBehind");return}Wm(e)}};const Km=r=>{let a=0;["video","audio"].forEach(function(e){const t=r[`${e}TimingInfo`];if(!t){return}const{start:i,end:s}=t;let n;if(typeof i==="bigint"||typeof s==="bigint"){n=Ly.BigInt(s)-Ly.BigInt(i)}else if(typeof i==="number"&&typeof s==="number"){n=s-i}if(typeof n!=="undefined"&&n>a){a=n}});if(typeof a==="bigint"&&a<Number.MAX_SAFE_INTEGER){a=Number(a)}return a};const Qm=({segmentDuration:e,maxDuration:t})=>{if(!e){return false}return Math.round(e)>t+Ih};const Jm=(e,t)=>{if(t!=="hls"){return null}const i=Km({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i){return null}const s=e.playlist.targetDuration;const n=Qm({segmentDuration:i,maxDuration:s*2});const r=Qm({segmentDuration:i,maxDuration:s});const a=`Segment with index ${e.mediaIndex} `+`from playlist ${e.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${e.duration} `+`and the target duration is ${s}. `+"For HLS content, a duration in excess of the target duration may result in "+"playback issues. See the HLS specification section on EXT-X-TARGETDURATION for "+"more details: "+"https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";if(n||r){return{severity:n?"warn":"info",message:a}}return null};const Zm=({type:e,segment:t})=>{if(!t){return}const i=Boolean(t.key||t.map&&t.map.ke);const s=Boolean(t.map&&!t.map.bytes);const n=t.startOfSegment===undefined?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:n,duration:t.duration,isEncrypted:i,isMediaInitialization:s}};class eg extends C.EventTarget{constructor(e,t={}){super();if(!e){throw new TypeError("Initialization settings are required")}if(typeof e.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}this.bandwidth=e.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.mediaIndex=null;this.partIndex=null;this.hasPlayed_=e.hasPlayed;this.currentTime_=e.currentTime;this.seekable_=e.seekable;this.seeking_=e.seeking;this.duration_=e.duration;this.mediaSource_=e.mediaSource;this.vhs_=e.vhs;this.loaderType_=e.loaderType;this.currentMediaInfo_=void 0;this.startingMediaInfo_=void 0;this.segmentMetadataTrack_=e.segmentMetadataTrack;this.goalBufferLength_=e.goalBufferLength;this.sourceType_=e.sourceType;this.sourceUpdater_=e.sourceUpdater;this.inbandTextTracks_=e.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=e.timelineChangeController;this.shouldSaveSegmentTimingInfo_=true;this.parse708captions_=e.parse708captions;this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset;this.captionServices_=e.captionServices;this.exactManifestTimings=e.exactManifestTimings;this.addMetadataToTextTrack=e.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;this.shouldForceTimestampOffsetAfterResync_=false;this.pendingSegment_=null;this.xhrOptions_=null;this.pendingSegments_=[];this.audioDisabled_=false;this.isPendingTimestampOffset_=false;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=false;this.appendInitSegment_={audio:true,video:true};this.playlistOfLastInitSegment_={audio:null,video:null};this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=null;this.activeInitSegmentId_=null;this.initSegments_={};this.cacheEncryptionKeys_=e.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=e.decrypter;this.syncController_=e.syncController;this.syncPoint_={segmentIndex:0,time:0};this.transmuxer_=this.createTransmuxer_();this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate");this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_);this.mediaSource_.addEventListener("sourceopen",()=>{if(!this.isEndOfStream_()){this.ended_=false}});this.fetchAtBuffer_=false;this.logger_=Eh(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(e){if(e!==this.state_){this.logger_(`${this.state_} -> ${e}`);this.state_=e;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}else{Xm(this)}});this.sourceUpdater_.on("codecschange",e=>{this.trigger(y({type:"codecschange"},e))});if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}else{Xm(this)}})}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",e=>{this.trigger(y({type:"timelinechange"},e));if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}else{Xm(this)}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}else{Xm(this)}})}}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Mp.createTransmuxer({remux:false,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:true,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0;this.mediaAppends=0}dispose(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();if(this.transmuxer_){this.transmuxer_.terminate()}this.resetStats_();if(this.checkBufferTimeout_){Ly.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(e){this.audioDisabled_=!e;if(e){this.appendInitSegment_.audio=true}else{this.sourceUpdater_.removeAudio(0,this.duration_())}}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}abort_(){if(this.pendingSegment_&&this.pendingSegment_.abortRequests){this.pendingSegment_.abortRequests()}this.pendingSegment_=null;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.waitingOnRemove_=false;Ly.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==e){return true}return false}error(e){if(typeof e!=="undefined"){this.logger_("error occurred:",e);this.error_=e}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){Mp.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t){return R()}if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:s,isMuxed:e}=t;if(s&&i&&!this.audioDisabled_&&!e){return this.sourceUpdater_.buffered()}if(s){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=false){if(!e){return null}const i=Hf(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}}return s||e}segmentKey(e,t=false){if(!e){return null}const i=Gf(e);let s=this.keyCache_[i];if(this.cacheEncryptionKeys_&&t&&!s&&e.bytes){this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes}}const n={resolvedUri:(s||e).resolvedUri};if(s){n.bytes=s.bytes}return n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){this.monitorBuffer_();if(!this.playlist_){return}if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(e,t={}){if(!e){return}const i=this.playlist_;const s=this.pendingSegment_;this.playlist_=e;this.xhrOptions_=t;if(this.state==="INIT"){e.syncInfo={mediaSequence:e.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(e)}}let n=null;if(i){if(i.id){n=i.id}else if(i.uri){n=i.uri}}this.logger_(`playlist update [${n} => ${e.id||e.uri}]`);if(this.mediaSequenceSync_){this.mediaSequenceSync_.update(e,this.currentTime_());this.logger_(`Playlist update: currentTime: ${this.currentTime_()} bufferedEnd: ${Mh(this.buffered_())} `,this.mediaSequenceSync_.diagnostics)}this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==e.uri){if(this.mediaIndex!==null){const a=!e.endList&&typeof e.partTargetDuration==="number";if(a){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=e.mediaSequence-i.mediaSequence;this.logger_(`live window shift [${r}]`);if(this.mediaIndex!==null){this.mediaIndex-=r;if(this.mediaIndex<0){this.mediaIndex=null;this.partIndex=null}else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=l}}}if(s){s.mediaIndex-=r;if(s.mediaIndex<0){s.mediaIndex=null;s.partIndex=null}else{if(s.mediaIndex>=0){s.segment=e.segments[s.mediaIndex]}if(s.partIndex>=0&&s.segment.parts){s.part=s.segment.parts[s.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){if(this.checkBufferTimeout_){Ly.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true};this.resetLoader();this.remove(0,Infinity,e);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;if(this.mediaSequenceSync_){this.mediaSequenceSync_.resetAppendedStatus()}this.resyncLoader()}resyncLoader(){if(this.transmuxer_){Mp.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;const t=this.sourceType_==="hls"&&!e;if(t){this.shouldForceTimestampOffsetAfterResync_=true}this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(e,t,i=()=>{},s=false){if(t===Infinity){t=this.duration_()}if(t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const r=()=>{n--;if(n===0){i()}};if(s||!this.audioDisabled_){n++;this.sourceUpdater_.removeAudio(e,t,r)}if(s||this.loaderType_==="main"){this.gopBuffer_=Rm(this.gopBuffer_,e,t,this.timeMapping_);n++;this.sourceUpdater_.removeVideo(e,t,r)}for(const a in this.inbandTextTracks_){Dm(e,t,this.inbandTextTracks_[a])}Dm(e,t,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){Ly.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=Ly.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){Ly.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=Ly.setTimeout(this.monitorBufferTick_.bind(this),Um)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const e=this.chooseNextRequest_();if(!e){return}const t={segmentInfo:Zm({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t});if(typeof e.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})}this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_){return false}const s=typeof e==="number"&&t.segments[e];const n=e+1===t.segments.length;const r=!s||!s.parts||i+1===s.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const e=this.buffered_();const s=Mh(e)||0;const t=Uh(e,this.currentTime_());const i=!this.hasPlayed_()&&t>=1;const n=t>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||i||n){return null}this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest){a.mediaIndex=Nm(this.currentTimeline_,r,s);this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`)}else if(this.mediaIndex!==null){const d=r[this.mediaIndex];const h=typeof this.partIndex==="number"?this.partIndex:-1;a.startOfSegment=d.end?d.end:s;if(d.parts&&d.parts[h+1]){a.mediaIndex=this.mediaIndex;a.partIndex=h+1}else{a.mediaIndex=this.mediaIndex+1}}else{let e;let t;let i;const f=this.fetchAtBuffer_?s:this.currentTime_();if(this.mediaSequenceSync_){this.logger_(`chooseNextRequest_ request after Quality Switch: For TargetTime: ${f}. CurrentTime: ${this.currentTime_()} BufferedEnd: ${s} Fetch At Buffer: ${this.fetchAtBuffer_} `,this.mediaSequenceSync_.diagnostics)}if(this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const p=this.getSyncInfoFromMediaSequenceSync_(f);if(!p){const m="No sync info found while using media sequence sync";this.error({message:m,metadata:{errorType:C.Error.StreamingFailedToSelectNextSegment,error:new Error(m)}});this.logger_("chooseNextRequest_ - no sync info found using media sequence sync");return null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${p.start} --> ${p.end})`);e=p.segmentIndex;t=p.partIndex;i=p.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const g=cf.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:f,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=g.segmentIndex;t=g.partIndex;i=g.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${f}`:`currentTime ${f}`;a.mediaIndex=e;a.startOfSegment=i;a.partIndex=t;this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=r[a.mediaIndex];let l=o&&typeof a.partIndex==="number"&&o.parts&&o.parts[a.partIndex];if(!o||typeof a.partIndex==="number"&&!l){return null}if(typeof a.partIndex!=="number"&&o.parts){a.partIndex=0;l=o.parts[0]}const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!t&&l&&!c&&!l.independent){if(a.partIndex===0){const y=r[a.mediaIndex-1];const _=y.parts&&y.parts.length&&y.parts[y.parts.length-1];if(_&&_.independent){a.mediaIndex-=1;a.partIndex=y.parts.length-1;a.independent="previous segment"}}else if(o.parts[a.partIndex-1].independent){a.partIndex-=1;a.independent="previous part"}}const u=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(a.mediaIndex>=r.length-1&&u&&!this.seeking_()){return null}if(this.shouldForceTimestampOffsetAfterResync_){this.shouldForceTimestampOffsetAfterResync_=false;a.forceTimestampOffset=true;this.logger_("choose next request. Force timestamp offset after loader resync")}return this.generateSegmentInfo_(a)}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_){return null}const t=Math.max(e,this.mediaSequenceSync_.start);if(e!==t){this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`)}const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i){return null}if(!i.isAppended){return i}const s=this.mediaSequenceSync_.getSyncInfoForTime(i.end);if(!s){return null}if(s.isAppended){this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!")}return s}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e;const c=i.segments[s];const u=typeof a==="number"&&c.parts[a];const d={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:u?a:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:u&&u.duration||c.duration,segment:c,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t};const h=typeof o!=="undefined"?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});const f=Mh(this.sourceUpdater_.audioBuffered());if(typeof f==="number"){d.audioAppendStart=f-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){d.gopsToAlignWith=Om(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return d}timestampOffsetForSegment_(e){return Hm(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3){return}const t=this.currentTime_();const i=e.bandwidth;const s=this.pendingSegment_.duration;const n=cf.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived);const r=Rh(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r){return}const a=ym({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a){return}const o=n-r;const l=o-a.rebufferingImpact;let c=.5;if(r<=Ih){c=1}if(!a.playlist||a.playlist.uri===this.playlist_.uri||l<c){return}this.bandwidth=a.playlist.attributes.BANDWIDTH*L.BANDWIDTH_VARIANCE+1;this.trigger("earlyabort")}handleAbort_(e){this.logger_(`Aborting ${Vm(e)}`);this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:s}=t;const n={segmentInfo:Zm({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n});this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(this.checkForIllegalMediaSwitch(t)){return}t=t||{};if(!Lm(this.currentMediaInfo_,t)){this.appendInitSegment_={audio:true,video:true};this.startingMediaInfo_=t;this.currentMediaInfo_=t;this.logger_("trackinfo update",t);this.trigger("trackinfo")}if(this.checkForAbort_(e.requestId)){return}this.pendingSegment_.trackInfo=t;if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}else{Xm(this)}}handleTimingInfo_(e,t,i,s){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}const n=this.pendingSegment_;const r=$m(t);n[r]=n[r]||{};n[r][i]=s;this.logger_(`timinginfo: ${t} - ${i} - ${s}`);if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}else{Xm(this)}}handleCaptions_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}const i=this.pendingSegment_;if(!i.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();const a={};t.forEach(e=>{a[e.stream]=a[e.stream]||{startTime:Infinity,captions:[],endTime:0};const t=a[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r);t.endTime=Math.max(t.endTime,e.endTime+r);t.captions.push(e)});Object.keys(a).forEach(e=>{const{startTime:t,endTime:i,captions:s}=a[e];const n=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`);Tm(n,this.vhs_.tech_,e);Dm(t,i,n[e]);Sm({captionArray:s,inbandTextTracks:n,timestampOffset:r})});if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}const s=this.pendingSegment_;if(!s.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e());this.metadataQueue_.caption.forEach(e=>e());this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[];e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[];e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const e=this.pendingSegment_;if(!e){return false}if(!this.getCurrentMediaInfo_()){return true}if(Gm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()){return false}if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_){return false}const e=this.pendingSegment_;const t=this.getCurrentMediaInfo_();if(!e||!t){return false}const{hasAudio:i,hasVideo:s,isMuxed:n}=t;if(s&&!e.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo){return false}if(Gm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}handleData_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Xm(this);this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(e.map){e.map=this.initSegmentForMap(e.map,true);i.segment.map=e.map}if(e.key){this.segmentKey(e.key,true)}i.isFmp4=e.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[$m(t.type)].start}else{const s=this.getCurrentMediaInfo_();const n=this.loaderType_==="main"&&s&&s.hasVideo;let e;if(n){e=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,t.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=true;this.processMetadataQueue_();this.appendData_(i,t)}updateAppendInitSegmentStatus(e,t){if(this.loaderType_==="main"&&typeof e.timestampOffset==="number"&&!e.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[t]!==e.playlist){this.appendInitSegment_[t]=true}}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){const n=Hf(i);if(this.activeInitSegmentId_===n){return null}t=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=n}if(t&&this.appendInitSegment_[e]){this.playlistOfLastInitSegment_[e]=s;this.appendInitSegment_[e]=false;this.activeInitSegmentId_=null;return t}return null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){const n=this.sourceUpdater_.audioBuffered();const r=this.sourceUpdater_.videoBuffered();if(n.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Lh(n).join(", "))}if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Lh(r).join(", "))}const a=n.length?n.start(0):0;const o=n.length?n.end(n.length-1):0;const l=r.length?r.start(0):0;const c=r.length?r.end(r.length-1):0;if(o-a<=Mm&&c-l<=Mm){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${i.byteLength}, `+`audio buffer: ${Lh(n).join(", ")}, `+`video buffer: ${Lh(r).join(", ")}, `);this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity});this.trigger("error");return}this.waitingOnRemove_=true;this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const u=this.currentTime_();const d=u-Mm;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`);this.remove(0,d,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Mm}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=Ly.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()},Mm*1e3)},true)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){if(!s){return}if(s.code===Tf){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s);this.error({message:`${t} append of ${i.length}b failed for segment `+`#${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:C.Error.StreamingFailedToAppendSegment}});this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const a=[s];let e=s.byteLength;if(i){a.unshift(i);e+=i.byteLength}n=vm({bytes:e,segments:a})}const r={segmentInfo:Zm({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:r});this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId){return}const s=this.pendingSegment_.segment;const n=`${e}TimingInfo`;if(!s[n]){s[n]={}}s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0;s[n].transmuxedPresentationStart=i.start.presentation;s[n].transmuxedDecodeStart=i.start.decode;s[n].transmuxedPresentationEnd=i.end.presentation;s[n].transmuxedDecodeEnd=i.end.decode;s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s})}loadSegment_(t){this.state="WAITING";this.pendingSegment_=t;this.trimBackBuffer_(t);if(typeof t.timestampOffset==="number"){if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}}if(!this.hasEnoughInfoToLoad_()){Xm(this);this.loadQueue_.push(()=>{const e=y({},t,{forceTimestampOffset:true});y(t,this.generateSegmentInfo_(e));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(t)});return}this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(s){if(this.shouldUpdateTransmuxerTimestampOffset_(s.timestampOffset)){this.gopBuffer_.length=0;s.gopsToAlignWith=[];this.timeMapping_=0;this.transmuxer_.postMessage({action:"reset"});this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:s.timestampOffset})}const e=this.createSimplifiedSegmentObj_(s);const t=this.isEndOfStream_(s.mediaIndex,s.playlist,s.partIndex);const i=this.mediaIndex!==null;const n=s.timeline!==this.currentTimeline_&&s.timeline>0;const r=t||i&&n;this.logger_(`Requesting ${bm(s.uri)} ${Vm(s)}`);if(e.map&&!e.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}s.abortRequests=em({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:e,abortFn:this.handleAbort_.bind(this,s),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",s.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",s.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:e,level:t,stream:i})=>{this.logger_(`${Vm(s)} logged from transmuxer stream ${i} as a ${t}: ${e}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:s,timingInfo:n})=>{const r=Zm({segment:t});const a={segmentInfo:r};if(i){a.keyInfo=i}if(s){a.trackInfo=s}if(n){a.timingInfo=n}this.trigger({type:e,metadata:a})}})}trimBackBuffer_(e){const t=jm(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(t>0){this.remove(0,t)}}createSimplifiedSegmentObj_(e){const t=e.segment;const i=e.part;const s=e.segment.key||e.segment.map&&e.segment.map.key;const n=e.segment.map&&!e.segment.map.bytes;const r={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:s,isMediaInitialization:n};const a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline){if(a.videoTimingInfo){r.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd}else if(a.audioTimingInfo){r.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd}}if(t.key){const o=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key);r.key.iv=o}if(t.map){r.map=this.initSegmentForMap(t.map)}return r}saveTransferStats_(e){this.mediaRequests+=1;if(e){this.mediaBytesTransferred+=e.bytesReceived;this.mediaTransferDuration+=e.roundTripTime}}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived;if(e<Fm){this.logger_(`Ignoring segment's bandwidth because its duration of ${e}`+` is less than the min to record ${Fm}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i});this.bandwidth=t.bandwidth;this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}this.saveTransferStats_(t.stats);if(!this.pendingSegment_){return}if(t.requestId!==this.pendingSegment_.requestId){return}if(e){this.pendingSegment_=null;this.state="READY";if(e.code===Bp.ABORTED){return}this.pause();if(e.code===Bp.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1;this.error(e);this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats);s.endOfAllRequests=t.endOfAllRequests;if(i.gopInfo){this.gopBuffer_=Pm(this.gopBuffer_,i.gopInfo,this.safeAppend_)}this.state="APPENDING";this.trigger("appending");this.waitForAppendsToComplete_(s)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);if(t!==null){this.timeMapping_=t}}updateMediaSecondsLoaded_(e){if(typeof e.start==="number"&&typeof e.end==="number"){this.mediaSecondsLoaded+=e.end-e.start}else{this.mediaSecondsLoaded+=e.duration}}shouldUpdateTransmuxerTimestampOffset_(e){if(e===null){return false}if(this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()){return true}if(!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()){return true}return false}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){if(typeof e!=="undefined"){return e}if(!r){return o.start}const l=t.segments[i-1];if(i===0||!l||typeof l.start==="undefined"||l.end!==s+n){return s}return a.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:Infinity});this.trigger("error");return}const{hasAudio:i,hasVideo:s,isMuxed:n}=t;const r=this.loaderType_==="main"&&s;const a=!this.audioDisabled_&&i&&!n;e.waitingOnAppends=0;if(!e.hasAppendedData_){if(!e.timingInfo&&typeof e.timestampOffset==="number"){this.isPendingTimestampOffset_=true}e.timingInfo={start:0};e.waitingOnAppends++;if(!this.isPendingTimestampOffset_){this.updateSourceBufferTimestampOffset_(e);this.processMetadataQueue_()}this.checkAppendsDone_(e);return}if(r){e.waitingOnAppends++}if(a){e.waitingOnAppends++}if(r){this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e))}if(a){this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}}checkAppendsDone_(e){if(this.checkForAbort_(e.requestId)){return}e.waitingOnAppends--;if(e.waitingOnAppends===0){this.handleAppendsDone_()}}checkForIllegalMediaSwitch(e){const t=qm(this.loaderType_,this.getCurrentMediaInfo_(),e);if(t){this.error({message:t,playlistExclusionDuration:Infinity});this.trigger("error");return true}return false}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!=="number"||e.changedTimestampOffset||this.loaderType_!=="main"){return}let t=false;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo});e.changedTimestampOffset=true;if(e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()){this.sourceUpdater_.videoTimestampOffset(e.timestampOffset);t=true}if(e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()){this.sourceUpdater_.audioTimestampOffset(e.timestampOffset);t=true}if(t){this.trigger("timestampoffset")}}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){if(!this.useDtsForTimestampOffset_){return i.start}if(e&&typeof e.transmuxedDecodeStart==="number"){return e.transmuxedDecodeStart}if(t&&typeof t.transmuxedDecodeStart==="number"){return t.transmuxedDecodeStart}return i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_();const i=this.loaderType_==="main"&&t&&t.hasVideo;const s=i&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;if(!s){return}e.timingInfo.end=typeof s.end==="number"?s.end:s.start+e.duration}handleAppendsDone_(){if(this.pendingSegment_){const o={segmentInfo:Zm({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:o})}if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}const e=this.pendingSegment_;if(e.part&&e.part.syncInfo){e.part.syncInfo.markAppended()}else if(e.segment.syncInfo){e.segment.syncInfo.markAppended()}this.updateTimingInfoEnd_(e);if(this.shouldSaveSegmentTimingInfo_){this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"})}const t=Jm(e,this.sourceType_);if(t){if(t.severity==="warn"){C.log.warn(t.message)}else{this.logger_(t.message)}}this.recordThroughput_(e);this.pendingSegment_=null;this.state="READY";if(e.isSyncRequest){this.trigger("syncinfoupdate");if(!e.hasAppendedData_){this.logger_(`Throwing away un-appended sync request ${Vm(e)}`);return}}this.logger_(`Appended ${Vm(e)}`);this.addSegmentMetadataCue_(e);this.fetchAtBuffer_=true;if(this.currentTimeline_!==e.timeline){this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline});if(this.loaderType_==="main"&&!this.audioDisabled_){this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})}}this.currentTimeline_=e.timeline;this.trigger("syncinfoupdate");const i=e.segment;const s=e.part;const n=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3;const r=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${Vm(e)}`);this.resetEverything();return}const a=this.mediaIndex!==null;if(a){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=e.mediaIndex;this.partIndex=e.partIndex;if(this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)){this.endOfStream()}this.trigger("appended");if(e.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(e){if(e.duration<Fm){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration}`+` is less than the min to record ${Fm}`);return}const t=this.throughput.rate;const i=Date.now()-e.endOfAllRequests+1;const s=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_){return}const t=e.segment;const i=t.start;const s=t.end;if(!Bm(i)||!Bm(s)){return}Dm(i,s,this.segmentMetadataTrack_);const n=Ly.WebKitDataCue||Ly.VTTCue;const r={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:s};const a=JSON.stringify(r);const o=new n(i,s,a);o.value=r;this.segmentMetadataTrack_.addCue(o)}}function tg(){}const ig=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toUpperCase())};const sg=["video","audio"];const ng=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]};const rg=(t,i)=>{for(let e=0;e<i.length;e++){const s=i[e];if(s.type==="mediaSource"){return null}if(s.type===t){return e}}return null};const ag=(e,t)=>{if(t.queue.length===0){return}let i=0;let s=t.queue[i];if(s.type==="mediaSource"){if(!t.updating()&&t.mediaSource.readyState!=="closed"){t.queue.shift();s.action(t);if(s.doneFn){s.doneFn()}ag("audio",t);ag("video",t)}return}if(e==="mediaSource"){return}if(!t.ready()||t.mediaSource.readyState==="closed"||ng(e,t)){return}if(s.type!==e){i=rg(e,t.queue);if(i===null){return}s=t.queue[i]}t.queue.splice(i,1);t.queuePending[e]=s;s.action(e,t);if(!s.doneFn){t.queuePending[e]=null;ag(e,t);return}};const og=(e,t)=>{const i=t[`${e}Buffer`];const s=ig(e);if(!i){return}i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]);i.removeEventListener("error",t[`on${s}Error_`]);t.codecs[e]=null;t[`${e}Buffer`]=null};const lg=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1;const cg={appendBuffer:(s,n,r)=>(t,i)=>{const e=i[`${t}Buffer`];if(!lg(i.mediaSource,e)){return}i.logger_(`Appending segment ${n.mediaIndex}'s ${s.length} bytes to ${t}Buffer`);try{e.appendBuffer(s)}catch(e){i.logger_(`Error with code ${e.code} `+(e.code===Tf?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${n.mediaIndex} to ${t}Buffer`);i.queuePending[t]=null;r(e)}},remove:(s,n)=>(t,i)=>{const e=i[`${t}Buffer`];if(!lg(i.mediaSource,e)){return}i.logger_(`Removing ${s} to ${n} from ${t}Buffer`);try{e.remove(s,n)}catch(e){i.logger_(`Remove ${s} to ${n} from ${t}Buffer failed`)}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];if(!lg(t.mediaSource,i)){return}t.logger_(`Setting ${e}timestampOffset to ${s}`);i.timestampOffset=s},callback:i=>(e,t)=>{i()},endOfStream:t=>e=>{if(e.mediaSource.readyState!=="open"){return}e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(e){C.log.warn("Failed to call media source endOfStream",e)}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(e){C.log.warn("Failed to set media source duration",e)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open"){return}const i=e[`${t}Buffer`];if(!lg(e.mediaSource,i)){return}e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){C.log.warn(`Failed to abort on ${t}Buffer`,e)}},addSourceBuffer:(n,r)=>e=>{const t=ig(n);const i=vo(r);e.logger_(`Adding ${n}Buffer with codec ${r} to mediaSource`);const s=e.mediaSource.addSourceBuffer(i);s.addEventListener("updateend",e[`on${t}UpdateEnd_`]);s.addEventListener("error",e[`on${t}Error_`]);e.codecs[n]=r;e[`${n}Buffer`]=s},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];og(i,e);if(!lg(e.mediaSource,t)){return}e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(e){C.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,e)}},changeType:l=>(t,i)=>{const e=i[`${t}Buffer`];const s=vo(l);if(!lg(i.mediaSource,e)){return}const n=l.substring(0,l.indexOf("."));const r=i.codecs[t];const a=r.substring(0,r.indexOf("."));if(a===n){return}const o={codecsChangeInfo:{from:r,to:l}};i.trigger({type:"codecschange",metadata:o});i.logger_(`changing ${t}Buffer codec from ${r} to ${l}`);try{e.changeType(s);i.codecs[t]=l}catch(e){o.errorType=C.Error.StreamingCodecsChangeError;o.error=e;e.metadata=o;i.error_=e;i.trigger("error");C.log.warn(`Failed to changeType on ${t}Buffer`,e)}}};const ug=({type:e,sourceUpdater:t,action:i,doneFn:s,name:n})=>{t.queue.push({type:e,action:i,doneFn:s,name:n});ag(e,t)};const dg=(n,r)=>e=>{const t=r[`${n}Buffered`]();const i=wh(t);r.logger_(`received "updateend" event for ${n} Source Buffer: `,i);if(r.queuePending[n]){const s=r.queuePending[n].doneFn;r.queuePending[n]=null;if(s){s(r[`${n}Error_`])}}ag(n,r)};class hg extends C.EventTarget{constructor(e){super();this.mediaSource=e;this.sourceopenListener_=()=>ag("mediaSource",this);this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=Eh("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=dg("video",this);this.onAudioUpdateEnd_=dg("audio",this);this.onVideoError_=e=>{this.videoError_=e};this.onAudioError_=e=>{this.audioError_=e};this.createdSourceBuffers_=false;this.initializedEme_=false;this.triggeredReady_=false}initializedEme(){this.initializedEme_=true;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(e);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(e,t){ug({type:"mediaSource",sourceUpdater:this,action:cg.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){ug({type:e,sourceUpdater:this,action:cg.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){C.log.error("removeSourceBuffer is not supported!");return}ug({type:"mediaSource",sourceUpdater:this,action:cg.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!C.browser.IS_FIREFOX&&Ly.MediaSource&&Ly.MediaSource.prototype&&typeof Ly.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return Ly.SourceBuffer&&Ly.SourceBuffer.prototype&&typeof Ly.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){C.log.error("changeType is not supported!");return}ug({type:e,sourceUpdater:this,action:cg.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(i){if(!i||typeof i!=="object"||Object.keys(i).length===0){throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs")}Object.keys(i).forEach(e=>{const t=i[e];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(e,t)}if(this.canChangeType()){this.changeType(e,t)}})}appendBuffer(e,t){const{segmentInfo:i,type:s,bytes:n}=e;this.processedAppend_=true;if(s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]);this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=t;ug({type:s,sourceUpdater:this,action:cg.appendBuffer(n,i||{mediaIndex:-1},r),doneFn:t,name:"appendBuffer"});if(s==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const a=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${a.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;a.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){if(!lg(this.mediaSource,this.audioBuffer)){return R()}return this.audioBuffer.buffered?this.audioBuffer.buffered:R()}videoBuffered(){if(!lg(this.mediaSource,this.videoBuffer)){return R()}return this.videoBuffer.buffered?this.videoBuffer.buffered:R()}buffered(){const e=lg(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const t=lg(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e){return this.audioBuffered()}if(e&&!t){return this.videoBuffered()}return Oh(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=tg){ug({type:"mediaSource",sourceUpdater:this,action:cg.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=tg){if(typeof e!=="string"){e=undefined}ug({type:"mediaSource",sourceUpdater:this,action:cg.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=tg){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}ug({type:"audio",sourceUpdater:this,action:cg.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=tg){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}ug({type:"video",sourceUpdater:this,action:cg.remove(e,t),doneFn:i,name:"remove"})}updating(){if(ng("audio",this)||ng("video",this)){return true}return false}audioTimestampOffset(e){if(typeof e!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e){ug({type:"audio",sourceUpdater:this,action:cg.timestampOffset(e),name:"timestampOffset"});this.audioTimestampOffset_=e}return this.audioTimestampOffset_}videoTimestampOffset(e){if(typeof e!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset_!==e){ug({type:"video",sourceUpdater:this,action:cg.timestampOffset(e),name:"timestampOffset"});this.videoTimestampOffset_=e}return this.videoTimestampOffset_}audioQueueCallback(e){if(!this.audioBuffer){return}ug({type:"audio",sourceUpdater:this,action:cg.callback(e),name:"callback"})}videoQueueCallback(e){if(!this.videoBuffer){return}ug({type:"video",sourceUpdater:this,action:cg.callback(e),name:"callback"})}dispose(){this.trigger("dispose");sg.forEach(e=>{this.abort(e);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(e)}else{this[`${e}QueueCallback`](()=>og(e,this))}});this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const fg=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e)));const pg=e=>{const t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")};const mg=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class gg extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class yg extends eg{constructor(e,t={}){super(e,t);this.mediaSource_=null;this.subtitlesTrack_=null;this.featuresNativeTextTracks_=e.featuresNativeTextTracks;this.loadVttJs=e.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return R()}const e=this.subtitlesTrack_.cues;const t=e[0].startTime;const i=e[e.length-1].startTime;return R([[t,i]])}initSegmentForMap(e,t=false){if(!e){return null}const i=Hf(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const n=mg.byteLength+e.bytes.byteLength;const r=new Uint8Array(n);r.set(e.bytes);r.set(mg,e.bytes.byteLength);this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(e){if(typeof e==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=e;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(e,t){Dm(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(!e){return}if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY";if(!this.paused()){this.monitorBuffer_()}};this.syncController_.one("timestampoffset",t);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){while(e&&e.segment.empty){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(t.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(e){if(e.code===Bp.TIMEOUT){this.handleTimeout_()}if(e.code===Bp.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(e);return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats);if(t.key){this.segmentKey(t.key,true)}this.state="APPENDING";this.trigger("appending");const n=s.segment;if(n.map){n.map.bytes=t.map.bytes}s.bytes=t.bytes;if(typeof Ly.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=true;try{this.parseVTTCues_(s)}catch(e){this.stopForError({message:e.message,metadata:{errorType:C.Error.StreamingVttParserError,error:e}});return}this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_);if(s.cues.length){s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}}else{s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration}}if(s.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}s.byteLength=s.bytes.byteLength;this.mediaSecondsLoaded+=n.duration;s.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Ly.VTTCue(e.startTime,e.endTime,e.text):e)});xm(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let e;let i=false;if(typeof Ly.WebVTT!=="function"){throw new gg}if(typeof Ly.TextDecoder==="function"){e=new Ly.TextDecoder("utf8")}else{e=Ly.WebVTT.StringDecoder();i=true}const s=new Ly.WebVTT.Parser(Ly,Ly.vttjs,e);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};s.oncue=t.cues.push.bind(t.cues);s.ontimestampmap=e=>{t.timestampmap=e};s.onparsingerror=e=>{C.log.warn("Error encountered when parsing cues: "+e.message)};if(t.segment.map){let e=t.segment.map.bytes;if(i){e=fg(e)}s.parse(e)}let n=t.bytes;if(i){n=fg(n)}s.parse(n);s.flush()}updateTimeMapping_(e,s,t){const i=e.segment;if(!s){return}if(!e.cues.length){i.empty=true;return}const{MPEGTS:n,LOCAL:r}=e.timestampmap;const a=n/bh;const o=a-r+s.mapping;e.cues.forEach(e=>{const t=e.endTime-e.startTime;const i=n===0?e.startTime+o:this.handleRollover_(e.startTime+o,s.time);e.startTime=Math.max(i,0);e.endTime=Math.max(i+t,0)});if(!t.syncInfo){const l=e.cues[0].startTime;const c=e.cues[e.cues.length-1].startTime;t.syncInfo={mediaSequence:t.mediaSequence+e.mediaIndex,time:Math.min(l,c-i.duration)}}}handleRollover_(e,t){if(t===null){return e}let i=e*bh;const s=t*bh;let n;if(s<i){n=-8589934592}else{n=8589934592}while(Math.abs(i-s)>4294967296){i+=n}return i/bh}}const _g=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const s=i[e];if(t>=s.adStartTime&&t<=s.adEndTime){return s}}return null};const vg=function(t,i,e=0){if(!t.segments){return}let s=e;let n;for(let e=0;e<t.segments.length;e++){const r=t.segments[e];if(!n){n=_g(i,s+r.duration/2)}if(n){if("cueIn"in r){n.endTime=s;n.adEndTime=s;s+=r.duration;n=null;continue}if(s<n.endTime){s+=r.duration;continue}n.endTime+=r.duration}else{if("cueOut"in r){n=new Ly.VTTCue(s,s+r.duration,r.cueOut);n.adStartTime=s;n.adEndTime=s+parseFloat(r.cueOut);i.addCue(n)}if("cueOutCont"in r){const[a,o]=r.cueOutCont.split("/").map(parseFloat);n=new Ly.VTTCue(s,s+r.duration,"");n.adStartTime=s-a;n.adEndTime=n.adStartTime+o;i.addCue(n)}}s+=r.duration}};class bg{constructor({start:e,end:t,segmentIndex:i,partIndex:s=null,appended:n=false}){this.start_=e;this.end_=t;this.segmentIndex_=i;this.partIndex_=s;this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=true}resetAppendedStatus(){this.appended_=false}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Tg{constructor(e,t=[]){this.segmentSyncInfo_=e;this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus();this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Sg{constructor(){this.storage_=new Map;this.diagnostics_="";this.isReliable_=false;this.start_=-Infinity;this.end_=Infinity}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:s}=e;this.isReliable_=this.isReliablePlaylist_(i,s);if(!this.isReliable_){return}return this.updateStorage_(s,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values()){if(!i.length){if(t.isInRange(e)){return t}}else{for(const s of i){if(s.isInRange(e)){return s}}}}return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const c=new Map;let u="\n";let d=i;let h=t;this.start_=d;e.forEach((e,a)=>{const o=this.storage_.get(h);const t=d;const i=t+e.duration;const s=Boolean(o&&o.segmentSyncInfo&&o.segmentSyncInfo.isAppended);const n=new bg({start:t,end:i,appended:s,segmentIndex:a});e.syncInfo=n;let l=d;const r=(e.parts||[]).map((e,t)=>{const i=l;const s=l+e.duration;const n=Boolean(o&&o.partsSyncInfo&&o.partsSyncInfo[t]&&o.partsSyncInfo[t].isAppended);const r=new bg({start:i,end:s,appended:n,segmentIndex:a,partIndex:t});l=s;u+=`Media Sequence: ${h}.${t} | Range: ${i} --> ${s} | Appended: ${n}\n`;e.syncInfo=r;return r});c.set(h,new Tg(n,r));u+=`${bm(e.resolvedUri)} | Media Sequence: ${h} | Range: ${t} --> ${i} | Appended: ${s}\n`;h++;d=i});this.end_=d;this.storage_=c;this.diagnostics_=u}calculateBaseTime_(e,t){if(!this.storage_.size){return 0}if(this.storage_.has(e)){return this.storage_.get(e).segmentSyncInfo.start}return t}isReliablePlaylist_(e,t){return e!==undefined&&e!==null&&Array.isArray(t)&&t.length}}class Eg extends Sg{constructor(e){super();this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);if(i){return i.segmentSyncInfo.start}return 0}return super.calculateBaseTime_(e,t)}}const wg=86400;const Ig=[{name:"VOD",run:(e,t,i,s,n)=>{if(i!==Infinity){const r={time:0,segmentIndex:0,partIndex:null};return r}return null}},{name:"MediaSequence",run:(e,t,i,s,n,r)=>{const a=e.getMediaSequenceSync(r);if(!a){return null}if(!a.isReliable){return null}const o=a.getSyncInfoForTime(n);if(!o){return null}return{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}}},{name:"ProgramDateTime",run:(s,n,e,t,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length){return null}let a=null;let o=null;const l=Fh(n);r=r||0;for(let i=0;i<l.length;i++){const e=n.endList||r===0?i:l.length-(i+1);const c=l[e];const u=c.segment;const d=s.timelineToDatetimeMappings[u.timeline];if(!d||!u.dateTimeObject){continue}const h=u.dateTimeObject.getTime()/1e3;let t=h+d;if(u.parts&&typeof c.partIndex==="number"){for(let e=0;e<c.partIndex;e++){t+=u.parts[e].duration}}const f=Math.abs(r-t);if(o!==null&&(f===0||o<f)){break}o=f;a={time:t,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}return a}},{name:"Segment",run:(e,i,t,s,n)=>{let r=null;let a=null;n=n||0;const o=Fh(i);for(let t=0;t<o.length;t++){const e=i.endList||n===0?t:o.length-(t+1);const l=o[e];const c=l.segment;const u=l.part&&l.part.start||c&&c.start;if(c.timeline===s&&typeof u!=="undefined"){const d=Math.abs(n-u);if(a!==null&&a<d){break}if(!r||a===null||a>=d){a=d;r={time:u,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}}return r}},{name:"Discontinuity",run:(i,s,e,t,n)=>{let r=null;n=n||0;if(s.discontinuityStarts&&s.discontinuityStarts.length){let t=null;for(let e=0;e<s.discontinuityStarts.length;e++){const a=s.discontinuityStarts[e];const o=s.discontinuitySequence+e+1;const l=i.discontinuities[o];if(l){const c=Math.abs(n-l.time);if(t!==null&&t<c){break}if(!r||t===null||t>=c){t=c;r={time:l.time,segmentIndex:a,partIndex:null}}}}}return r}},{name:"Playlist",run:(e,t,i,s,n)=>{if(t.syncInfo){const r={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return r}return null}}];class Cg extends C.EventTarget{constructor(e={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};const t=new Sg;const i=new Eg(t);const s=new Eg(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:s};this.logger_=Eh("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,s,n){if(t!==Infinity){const a=Ig.find(({name:e})=>e==="VOD");return a.run(this,e,t)}const r=this.runStrategies_(e,t,i,s,n);if(!r.length){return null}for(const o of r){const{syncPoint:l,strategy:c}=o;const{segmentIndex:u,time:d}=l;if(u<0){continue}const h=e.segments[u];const f=d;const p=f+h.duration;this.logger_(`Strategy: ${c}. Current time: ${s}. selected segment: ${u}. Time: [${f} -> ${p}]}`);if(s>=f&&s<p){this.logger_("Found sync point with exact match: ",l);return l}}return this.selectSyncPoint_(r,{key:"time",value:s})}getExpiredTime(e,t){if(!e||!e.segments){return null}const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length){return null}const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});if(s.segmentIndex>0){s.time*=-1}return Math.abs(s.time+Wh({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(t,i,s,n,r){const a=[];for(let e=0;e<Ig.length;e++){const o=Ig[e];const l=o.run(this,t,i,s,n,r);if(l){l.strategy=o.name;a.push({strategy:o.name,syncPoint:l})}}return a}selectSyncPoint_(t,i){let s=t[0].syncPoint;let n=Math.abs(t[0].syncPoint[i.key]-i.value);let r=t[0].strategy;for(let e=1;e<t.length;e++){const a=Math.abs(t[e].syncPoint[i.key]-i.value);if(a<n){n=a;s=t[e].syncPoint;r=t[e].strategy}}this.logger_(`syncPoint for [${i.key}: ${i.value}] chosen with strategy`+` [${r}]: [time:${s.time},`+` segmentIndex:${s.segmentIndex}`+(typeof s.partIndex==="number"?`,partIndex:${s.partIndex}`:"")+"]");return s}saveExpiredSegmentInfo(t,i){const s=i.mediaSequence-t.mediaSequence;if(s>wg){C.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let e=s-1;e>=0;e--){const n=t.segments[e];if(n&&typeof n.start!=="undefined"){i.syncInfo={mediaSequence:t.mediaSequence+e,time:n.start};this.logger_(`playlist refresh sync: [time:${i.syncInfo.time},`+` mediaSequence: ${i.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){this.timelineToDatetimeMappings={};if(e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0];const i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t);const s=e.segment;if(i){this.saveDiscontinuitySyncInfo_(e);if(!e.playlist.syncInfo){e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}}}const n=s.dateTimeObject;if(s.discontinuity&&t&&n){this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3)}}timestampOffsetForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].time}mappingForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment;const n=e.part;let r=this.timelines[e.timeline];let a;let o;if(typeof e.timestampOffset==="number"){r={time:e.startOfSegment,mapping:e.startOfSegment-t.start};if(i){this.timelines[e.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${e.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}a=e.startOfSegment;o=t.end+r.mapping}else if(r){a=t.start+r.mapping;o=t.end+r.mapping}else{return false}if(n){n.start=a;n.end=o}if(!s.start||a<s.start){s.start=a}s.end=o;return true}saveDiscontinuitySyncInfo_(t){const i=t.playlist;const s=t.segment;if(s.discontinuity){this.discontinuities[s.timeline]={time:s.start,accuracy:0}}else if(i.discontinuityStarts&&i.discontinuityStarts.length){for(let e=0;e<i.discontinuityStarts.length;e++){const n=i.discontinuityStarts[e];const r=i.discontinuitySequence+e+1;const a=n-t.mediaIndex;const o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let e;if(a<0){e=s.start-Wh({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:t.mediaIndex,endIndex:n})}else{e=s.end+Wh({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:t.mediaIndex+1,endIndex:n})}this.discontinuities[r]={time:e,accuracy:o}}}}}dispose(){this.trigger("dispose");this.off()}}class kg extends C.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.pendingTimelineChanges_[e]={type:e,from:t,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i};delete this.pendingTimelineChanges_[e];const s={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const Ag=Tp(Sp(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var a=i.length;for(var o=0;o<a;++o){i[o].apply(this,r)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();function l(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}const u=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]];const t=e[0];const i=e[1];const s=t[4];const n=i[4];let r;let a;let o;const l=[];const c=[];let u;let d;let h;let f;let p;let m;for(r=0;r<256;r++){c[(l[r]=r<<1^(r>>7)*283)^r]=r}for(a=o=0;!s[a];a^=u||1,o=c[o]||1){f=o^o<<1^o<<2^o<<3^o<<4;f=f>>8^f&255^99;s[a]=f;n[f]=a;h=l[d=l[u=l[a]]];m=h*16843009^d*65537^u*257^a*16843008;p=l[f]*257^f*16843008;for(r=0;r<4;r++){t[r][a]=p=p<<24^p>>>8;i[r][f]=m=m<<24^m>>>8}}for(r=0;r<5;r++){t[r]=t[r].slice(0);i[r]=i[r].slice(0)}return e};let d=null;class g{constructor(e){if(!d){d=u()}this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];let t;let i;let s;const n=this._tables[0][4];const r=this._tables[1];const a=e.length;let o=1;if(a!==4&&a!==6&&a!==8){throw new Error("Invalid aes key size")}const l=e.slice(0);const c=[];this._key=[l,c];for(t=a;t<4*a+28;t++){s=l[t-1];if(t%a===0||a===8&&t%a===4){s=n[s>>>24]<<24^n[s>>16&255]<<16^n[s>>8&255]<<8^n[s&255];if(t%a===0){s=s<<8^s>>>24^o<<24;o=o<<1^(o>>7)*283}}l[t]=l[t-a]^s}for(i=0;t;i++,t--){s=l[i&3?t:t-4];if(t<=4||i<4){c[i]=s}else{c[i]=r[0][n[s>>>24]]^r[1][n[s>>16&255]]^r[2][n[s>>8&255]]^r[3][n[s&255]]}}}decrypt(e,t,i,s,n,r){const a=this._key[1];let o=e^a[0];let l=s^a[1];let c=i^a[2];let u=t^a[3];let d;let h;let f;const p=a.length/4-2;let m;let g=4;const y=this._tables[1];const _=y[0];const v=y[1];const b=y[2];const T=y[3];const S=y[4];for(m=0;m<p;m++){d=_[o>>>24]^v[l>>16&255]^b[c>>8&255]^T[u&255]^a[g];h=_[l>>>24]^v[c>>16&255]^b[u>>8&255]^T[o&255]^a[g+1];f=_[c>>>24]^v[u>>16&255]^b[o>>8&255]^T[l&255]^a[g+2];u=_[u>>>24]^v[o>>16&255]^b[l>>8&255]^T[c&255]^a[g+3];g+=4;o=d;l=h;c=f}for(m=0;m<4;m++){n[(3&-m)+r]=S[o>>>24]<<24^S[l>>16&255]<<16^S[c>>8&255]<<8^S[u&255]^a[g++];d=o;o=l;l=c;c=u;u=d}}}class c extends e{constructor(){super(e);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(e){this.jobs.push(e);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const y=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24};const r=function(e,t,i){const s=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2);const n=new g(Array.prototype.slice.call(t));const r=new Uint8Array(e.byteLength);const a=new Int32Array(r.buffer);let o;let l;let c;let u;let d;let h;let f;let p;let m;o=i[0];l=i[1];c=i[2];u=i[3];for(m=0;m<s.length;m+=4){d=y(s[m]);h=y(s[m+1]);f=y(s[m+2]);p=y(s[m+3]);n.decrypt(d,h,f,p,a,m);a[m]=y(a[m]^o);a[m+1]=y(a[m+1]^l);a[m+2]=y(a[m+2]^c);a[m+3]=y(a[m+3]^u);o=d;l=h;c=f;u=p}return r};class h{constructor(e,t,i,s){const n=h.STEP;const r=new Int32Array(e.buffer);const a=new Uint8Array(e.byteLength);let o=0;this.asyncStream_=new c;this.asyncStream_.push(this.decryptChunk_(r.subarray(o,o+n),t,i,a));for(o=n;o<r.length;o+=n){i=new Uint32Array([y(r[o-4]),y(r[o-3]),y(r[o-2]),y(r[o-1])]);this.asyncStream_.push(this.decryptChunk_(r.subarray(o,o+n),t,i,a))}this.asyncStream_.push(function(){s(null,l(a))})}static get STEP(){return 32e3}decryptChunk_(t,i,s,n){return function(){const e=r(t,i,s);n.set(e,t.byteOffset)}}}var t=typeof globalThis!=="undefined"?globalThis:typeof Ly!=="undefined"?Ly:typeof Ry!=="undefined"?Ry:typeof self!=="undefined"?self:{};var i;if(typeof Ly!=="undefined"){i=Ly}else if(typeof t!=="undefined"){i=t}else if(typeof self!=="undefined"){i=self}else{i={}}var s=i;var n=function e(t){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}return t&&t.buffer instanceof ArrayBuffer};var a=s.BigInt||Number;[a("0x1"),a("0x100"),a("0x10000"),a("0x1000000"),a("0x100000000"),a("0x10000000000"),a("0x1000000000000"),a("0x100000000000000"),a("0x10000000000000000")];(function(){var e=new Uint16Array([65484]);var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t[0]===255){return"big"}if(t[0]===204){return"little"}return"unknown"})();const o=function(i){const s={};Object.keys(i).forEach(e=>{const t=i[e];if(n(t)){s[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}else{s[e]=t}});return s};self.onmessage=function(e){const i=e.data;const t=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength);const s=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4);const n=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new h(t,s,n,function(e,t){self.postMessage(o({source:i.source,decrypted:t}),[t.buffer])})}}));var Dg=bp(Ag);const xg=e=>{let t=e.default?"main":"alternative";if(e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0){t="main-desc"}return t};const Og=(e,t)=>{e.abort();e.pause();if(t&&t.activePlaylistLoader){t.activePlaylistLoader.pause();t.activePlaylistLoader=null}};const Pg=(e,t)=>{t.activePlaylistLoader=e;e.load()};const Rg=(o,l)=>()=>{const{segmentLoaders:{[o]:e,main:t},mediaTypes:{[o]:i}}=l;const s=i.activeTrack();const n=i.getActiveGroup();const r=i.activePlaylistLoader;const a=i.lastGroup_;if(n&&a&&n.id===a.id){return}i.lastGroup_=n;i.lastTrack_=s;Og(e,i);if(!n||n.isMainPlaylist){return}if(!n.playlistLoader){if(r){t.resetEverything()}return}e.resyncLoader();Pg(n.playlistLoader,i)};const Lg=(i,s)=>()=>{const{segmentLoaders:{[i]:e},mediaTypes:{[i]:t}}=s;t.lastGroup_=null;e.abort();e.pause()};const Ng=(u,d)=>()=>{const{mainPlaylistLoader:e,segmentLoaders:{[u]:t,main:i},mediaTypes:{[u]:s}}=d;const n=s.activeTrack();const r=s.getActiveGroup();const a=s.activePlaylistLoader;const o=s.lastTrack_;if(o&&n&&o.id===n.id){return}s.lastGroup_=r;s.lastTrack_=n;Og(t,s);if(!r){return}if(r.isMainPlaylist){if(!n||!o||n.id===o.id){return}const l=d.vhs.playlistController_;const c=l.selectPlaylist();if(l.media()===c){return}s.logger_(`track change. Switching main audio from ${o.id} to ${n.id}`);e.pause();i.resetEverything();l.fastQualityChange_(c);return}if(u==="AUDIO"){if(!r.playlistLoader){i.setAudio(true);i.resetEverything();return}t.setAudio(true);i.setAudio(false)}if(a===r.playlistLoader){Pg(r.playlistLoader,s);return}if(t.track){t.track(n)}t.resetEverything();Pg(r.playlistLoader,s)};const Mg={AUDIO:(o,l)=>()=>{const{mediaTypes:{[o]:e},excludePlaylist:t}=l;const i=e.activeTrack();const s=e.activeGroup();const n=(s.filter(e=>e.default)[0]||s[0]).id;const r=e.tracks[n];if(i===r){t({error:{message:"Problem encountered loading the default audio track."}});return}C.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const a in e.tracks){e.tracks[a].enabled=e.tracks[a]===r}e.onTrackChanged()},SUBTITLES:(i,s)=>()=>{const{mediaTypes:{[i]:e}}=s;C.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");const t=e.activeTrack();if(t){t.mode="disabled"}e.onTrackChanged()}};const Ug={AUDIO:(e,t,i)=>{if(!t){return}const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n);if(!s.paused()||e.endList&&s.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),n);if(!s.paused()){r.load()}});t.on("error",Mg[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n);r.track(a.activeTrack());if(!s.paused()||e.endList&&s.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),n);if(!s.paused()){r.load()}});t.on("error",Mg[e](e,i))}};const Bg={AUDIO:(i,s)=>{const{vhs:n,sourceType:r,segmentLoaders:{[i]:e},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:c,logger_:u}},mainPlaylistLoader:d}=s;const h=lf(d.main);if(!o[i]||Object.keys(o[i]).length===0){o[i]={main:{default:{default:true}}};if(h){o[i].main.default.playlists=d.main.playlists}}for(const f in o[i]){if(!l[f]){l[f]=[]}for(const p in o[i][f]){let e=o[i][f][p];let t;if(h){u(`AUDIO group '${f}' label '${p}' is a main playlist`);e.isMainPlaylist=true;t=null}else if(r==="vhs-json"&&e.playlists){t=new Rf(e.playlists[0],n,a)}else if(e.resolvedUri){t=new Rf(e.resolvedUri,n,a)}else if(e.playlists&&r==="dash"){t=new gp(e.playlists[0],n,a,d)}else{t=null}e=M({id:p,playlistLoader:t},e);Ug[i](i,e.playlistLoader,s);l[f].push(e);if(typeof c[p]==="undefined"){const m=new C.AudioTrack({id:p,kind:xg(e),enabled:false,language:e.language,default:e.default,label:p});c[p]=m}}}e.on("error",Mg[i](i,s))},SUBTITLES:(i,s)=>{const{tech:n,vhs:r,sourceType:a,segmentLoaders:{[i]:e},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[i]:{groups:c,tracks:u}},mainPlaylistLoader:d}=s;for(const h in l[i]){if(!c[h]){c[h]=[]}for(const f in l[i][h]){if(!r.options_.useForcedSubtitles&&l[i][h][f].forced){continue}let e=l[i][h][f];let t;if(a==="hls"){t=new Rf(e.resolvedUri,r,o)}else if(a==="dash"){const p=e.playlists.filter(e=>e.excludeUntil!==Infinity);if(!p.length){return}t=new gp(e.playlists[0],r,o,d)}else if(a==="vhs-json"){t=new Rf(e.playlists?e.playlists[0]:e.resolvedUri,r,o)}e=M({id:f,playlistLoader:t},e);Ug[i](i,e.playlistLoader,s);c[h].push(e);if(typeof u[f]==="undefined"){const m=n.addRemoteTextTrack({id:f,kind:"subtitles",default:e.default&&e.autoselect,language:e.language,label:f},false).track;u[f]=m}}}e.on("error",Mg[i](i,s))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[t]:{groups:n,tracks:r}}}=e;for(const a in s[t]){if(!n[a]){n[a]=[]}for(const o in s[t][a]){const l=s[t][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId)){continue}const c=i.options_.vhs&&i.options_.vhs.captionServices||{};let e={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[e.instreamId]){e=M(e,c[e.instreamId])}if(e.default===undefined){delete e.default}n[a].push(M({id:o},l));if(typeof r[o]==="undefined"){const u=i.addRemoteTextTrack({id:e.instreamId,kind:"captions",default:e.default,language:e.language,label:e.label},false).track;r[o]=u}}}}};const Fg=(t,i)=>{for(let e=0;e<t.length;e++){if(af(i,t[e])){return true}if(t[e].playlists&&Fg(t[e].playlists,i)){return true}}return false};const qg=(o,l)=>t=>{const{mainPlaylistLoader:e,mediaTypes:{[o]:{groups:i}}}=l;const s=e.media();if(!s){return null}let n=null;if(s.attributes[o]){n=i[s.attributes[o]]}const r=Object.keys(i);if(!n){if(o==="AUDIO"&&r.length>1&&lf(l.main)){for(let e=0;e<r.length;e++){const a=i[r[e]];if(Fg(a,s)){n=a;break}}}else if(i.main){n=i.main}else if(r.length===1){n=i[r[0]]}}if(typeof t==="undefined"){return n}if(t===null||!n){return null}return n.filter(e=>e.id===t.id)[0]||null};const jg={AUDIO:(i,s)=>()=>{const{mediaTypes:{[i]:{tracks:e}}}=s;for(const t in e){if(e[t].enabled){return e[t]}}return null},SUBTITLES:(i,s)=>()=>{const{mediaTypes:{[i]:{tracks:e}}}=s;for(const t in e){if(e[t].mode==="showing"||e[t].mode==="hidden"){return e[t]}}return null}};const Vg=(t,{mediaTypes:i})=>()=>{const e=i[t].activeTrack();if(!e){return null}return i[t].activeGroup(e)};const $g=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{Bg[e](e,t)});const{mediaTypes:i,mainPlaylistLoader:e,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:a}}=t;["AUDIO","SUBTITLES"].forEach(e=>{i[e].activeGroup=qg(e,t);i[e].activeTrack=jg[e](e,t);i[e].onGroupChanged=Rg(e,t);i[e].onGroupChanging=Lg(e,t);i[e].onTrackChanged=Ng(e,t);i[e].getActiveGroup=Vg(e,t)});const o=i.AUDIO.activeGroup();if(o){const c=(o.filter(e=>e.default)[0]||o[0]).id;i.AUDIO.tracks[c].enabled=true;i.AUDIO.onGroupChanged();i.AUDIO.onTrackChanged();const u=i.AUDIO.getActiveGroup();if(!u.playlistLoader){a.setAudio(true)}else{a.setAudio(false);r.setAudio(true)}}e.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>i[e].onGroupChanged())});e.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>i[e].onGroupChanging())});const l=()=>{i.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l);s.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged);n.on("dispose",()=>{s.audioTracks().removeEventListener("change",l);s.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)});s.clearTracks("audio");for(const d in i.AUDIO.tracks){s.audioTracks().addTrack(i.AUDIO.tracks[d])}};const Hg=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:tg,activeTrack:tg,getActiveGroup:tg,onGroupChanged:tg,onTrackChanged:tg,lastTrack_:null,logger_:Eh(`MediaGroups[${e}]`)}});return t};class Gg{constructor(){this.priority_=[];this.pathwayClones_=new Map}set version(e){if(e===1){this.version_=e}}set ttl(e){this.ttl_=e||300}set reloadUri(e){if(e){this.reloadUri_=Th(this.reloadUri_,e)}}set priority(e){if(e&&e.length){this.priority_=e}}set pathwayClones(e){if(e&&e.length){this.pathwayClones_=new Map(e.map(e=>[e.ID,e]))}}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class zg extends C.EventTarget{constructor(e,t){super();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=false;this.availablePathways_=new Set;this.steeringManifest=new Gg;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.currentPathwayClones=new Map;this.nextPathwayClones=new Map;this.excludedSteeringManifestURLs=new Set;this.logger_=Eh("Content Steering");this.xhr_=e;this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`);this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=Th(e,i);this.defaultPathway=t.pathwayId||t.defaultServiceLocation;this.queryBeforeStart=t.queryBeforeStart;this.proxyServerUrl_=t.proxyServerURL;if(this.defaultPathway&&!this.queryBeforeStart){this.trigger("content-steering")}}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t){return}const a=e?t:this.getRequestURI(t);if(!a){this.logger_("No valid content steering manifest URIs. Stopping content steering.");this.trigger("error");this.dispose();return}const o={contentSteeringInfo:{uri:a}};this.trigger({type:"contentsteeringloadstart",metadata:o});this.request_=this.xhr_({uri:a,requestType:"content-steering-manifest"},(e,t)=>{if(e){if(t.status===410){this.logger_(`manifest request 410 ${e}.`);this.logger_(`There will be no more content steering requests to ${a} this session.`);this.excludedSteeringManifestURLs.add(a);return}if(t.status===429){const n=t.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${e}.`);this.logger_(`content steering will retry in ${n} seconds.`);this.startTTLTimeout_(parseInt(n,10));return}this.logger_(`manifest failed to load ${e}.`);this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:o});let i;try{i=JSON.parse(this.request_.responseText)}catch(e){const r={errorType:C.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:r})}this.assignSteeringProperties_(i);const s={contentSteeringInfo:o.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:s});this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new Ly.URL(e);const i=new Ly.URL(this.proxyServerUrl_);i.searchParams.set("url",encodeURI(t.toString()));return this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(Ly.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new Ly.URL(e);const i=this.getPathway();const s=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(s){const r=`_${this.manifestType_}_throughput`;t.searchParams.set(r,s)}return t.toString()}assignSteeringProperties_(e){this.steeringManifest.version=e.VERSION;if(!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`);this.trigger("error");return}this.steeringManifest.ttl=e.TTL;this.steeringManifest.reloadUri=e["RELOAD-URI"];this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"];this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"];this.nextPathwayClones=this.steeringManifest.pathwayClones;if(!this.availablePathways_.size){this.logger_("There are no available pathways for content steering. Ending content steering.");this.trigger("error");this.dispose()}const t=e=>{for(const t of e){if(this.availablePathways_.has(t)){return t}}return[...this.availablePathways_][0]};const i=t(this.steeringManifest.priority);if(this.currentPathway!==i){this.currentPathway=i;this.trigger("content-steering")}}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e){return null}const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const s=this.setProxyServerUrl_(e);if(!t(s)){return s}}const i=this.setSteeringParams_(e);if(!t(i)){return i}return null}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=Ly.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){Ly.clearTimeout(this.ttlTimeout_);this.ttlTimeout_=null}abort(){if(this.request_){this.request_.abort()}this.request_=null}dispose(){this.off("content-steering");this.off("error");this.abort();this.clearTTLTimeout_();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=null;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.excludedSteeringManifestURLs=new Set;this.availablePathways_=new Set;this.steeringManifest=new Gg}addAvailablePathway(e){if(e){this.availablePathways_.add(e)}}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Th(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Wg=10;let Yg;const Xg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const Kg=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};const Qg=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!s){C.log.warn("We received no playlist to switch to. Please check your stream.");return false}const c=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e){l(`${c} as current playlist is not set`);return true}if(s.id===e.id){return false}const u=Boolean(Ah(t,i).length);if(!e.endList){if(!u&&typeof e.partTargetDuration==="number"){l(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}l(`${c} as current playlist is live`);return true}const d=Uh(t,i);const h=o?L.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:L.MAX_BUFFER_LOW_WATER_LINE;if(a<h){l(`${c} as duration < max low water line (${a} < ${h})`);return true}const f=s.attributes.BANDWIDTH;const p=e.attributes.BANDWIDTH;if(f<p&&(!o||d<r)){let e=`${c} as next bandwidth < current bandwidth (${f} < ${p})`;if(o){e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${r})`}l(e);return true}if((!o||f>p)&&d>=n){let e=`${c} as forwardBuffer >= bufferLowWaterLine (${d} >= ${n})`;if(o){e+=` and next bandwidth > current bandwidth (${f} > ${p})`}l(e);return true}l(`not ${c} as no switching criteria met`);return false};class Jg extends C.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:n,bandwidth:s,externVhs:r,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:c,cacheEncryptionKeys:u,bufferBasedABR:d,leastPixelDiffSelector:h,captionServices:f}=e;if(!t){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:p}=e;if(p===null||typeof p==="undefined"){p=Infinity}Yg=r;this.bufferBasedABR=Boolean(d);this.leastPixelDiffSelector=Boolean(h);this.withCredentials=i;this.tech_=n;this.vhs_=n.vhs;this.player_=e.player_;this.sourceType_=c;this.useCueTags_=a;this.playlistExclusionDuration=o;this.maxPlaylistRetries=p;this.enableLowInitialPlaylist=l;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:p,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=Hg();this.mediaSource=new Ly.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=R();this.hasPlayed_=false;this.syncController_=new Cg(e);this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new Dg;this.sourceUpdater_=new hg(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new kg;this.keyStatusMap_=new Map;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:u,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new gp(t,this.vhs_,M(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Rf(t,this.vhs_,M(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new eg(M(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e);this.audioSegmentLoader_=new eg(M(m,{loaderType:"audio"}),e);this.subtitleSegmentLoader_=new yg(M(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){n.off("vttjserror",s);e()}function s(){n.off("vttjsloaded",i);t()}n.one("vttjsloaded",i);n.one("vttjserror",s);n.addWebVttScript_()})}),e);const g=()=>{return this.mainSegmentLoader_.bandwidth};this.contentSteeringController_=new zg(this.vhs_.xhr,g);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_());this.tech_.on("pause",()=>this.stopABRTimer_());this.tech_.on("play",()=>this.startABRTimer_())}Xg.forEach(e=>{this[e+"_"]=Kg.bind(this,e)});this.logger_=Eh("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()};this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const y=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(y,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_();const t=this.audioAppendsToLoadedData_();if(e===-1||t===-1){return-1}return e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();if(t&&this.shouldSwitchToMedia_(t)){this.switchMedia_(t,e)}}switchMedia_(e,t,i){const s=this.media();const n=s&&(s.id||s.uri);const r=e&&(e.id||e.uri);if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${t}`);const a={renditionInfo:{id:r,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:a});this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e];const i=t?t.activeGroup():null;const s=this.contentSteeringController_.getPathway();if(i&&s){const n=i.length?i[0].playlists:i.playlists;const r=n.filter(e=>e.attributes.serviceLocation===s);if(r.length){this.mediaTypes_[e].activePlaylistLoader.media(r[0])}}})}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=Ly.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}Ly.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const t=this.main();const e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO){return e}const i=t.mediaGroups.AUDIO;const s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){n=this.mediaTypes_.AUDIO.activeTrack()}else{const a=i.main||s.length&&i[s[0]];for(const o in a){if(a[o].default){n={label:o};break}}}if(!n){return e}const r=[];for(const l in i){if(i[l][n.label]){const c=i[l][n.label];if(c.playlists&&c.playlists.length){r.push.apply(r,c.playlists)}else if(c.uri){r.push(c)}else if(t.playlists.length){for(let e=0;e<t.playlists.length;e++){const u=t.playlists[e];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===l){r.push(u)}}}}}if(!r.length){return e}return r}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(rf(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}if(e.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.mainSegmentLoader_.load()}$g({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),e);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}});this.mainPlaylistLoader_.on("loadedplaylist",()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_();this.initContentSteeringController_();this.excludeUnsupportedVariants_();let e;if(this.enableLowInitialPlaylist){e=this.selectInitialPlaylist()}if(!e){e=this.selectPlaylist()}if(!e||!this.shouldSwitchToMedia_(e)){return}this.initialMedia_=e;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){return}t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)});this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()});this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(rf(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}if(this.sourceType_==="dash"){this.mainPlaylistLoader_.load()}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(e,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}else{this.mainSegmentLoader_.load()}this.tech_.trigger({type:"mediachange",bubbles:true})});this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged"){return}const t=this.stuckAtPlaylistEnd_(e);if(t){this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}});this.tech_.trigger("playliststuck")}});this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})});this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})});const e=["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"];e.forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(y({},e))})})}handleUpdatedMediaPlaylist(e){if(this.useCueTags_){this.updateAdCues_(e)}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(e,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}this.updateDuration(!e.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const r in i.AUDIO){for(const a in i.AUDIO[r]){const o=i.AUDIO[r][a];if(!o.uri){s=false}}}if(s){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(Yg.Playlist.isAes(t)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(n.length&&Object.keys(i.AUDIO[n[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const s=this.bufferLowWaterLine();const n=this.bufferHighWaterLine();const r=this.tech_.buffered();return Qg({buffered:r,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate");this.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("timeout",()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}});if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")})}this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended");this.onEndOfStream()});if(this.sourceType_==="dash"){this.timelineChangeController_.on("audioTimelineBehind",()=>{const e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo){return}const t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)})}this.mainSegmentLoader_.on("earlyabort",e=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:Wg})});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e);this.audioSegmentLoader_.on("trackinfo",e);this.mainSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()});const t=["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"];t.forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(y({},e))});this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(y({},e))});this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(y({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality");this.waitingForFastQualityPlaylistReceived_=true}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=false;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const e=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<e.start(0)){return this.tech_.setCurrentTime(e.end(e.length-1))}}}setupFirstPlay(){const i=this.mainPlaylistLoader_.media();if(!i||this.tech_.paused()||this.hasPlayed_){return false}if(!i.endList||i.start){const e=this.seekable();if(!e.length){return false}const s=e.end(0);let t=s;if(i.start){const n=i.start.timeOffset;if(n<0){t=Math.max(s+n,e.start(0))}else{t=Math.min(s,n)}}this.trigger("firstplay");this.tech_.setCurrentTime(t)}this.hasPlayed_=true;this.load();return true}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const e=this.tech_.play();if(typeof e!=="undefined"&&typeof e.then==="function"){e.then(null,e=>{})}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length){return}const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===Infinity?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!t||t.hasVideo){e=e&&this.audioSegmentLoader_.ended_}else{e=this.audioSegmentLoader_.ended_}}if(!e){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length){return false}const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return false}const s=Yg.Playlist.playlistEnd(e,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=Ch}const a=r.end(r.length-1);return a-n<=Ch&&s-a<=Ch}excludePlaylist({playlistToExclude:s=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:t}){s=s||this.mainPlaylistLoader_.media();t=t||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!s){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}s.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists;const i=n.filter(Zh);const r=i.length===1&&i[0]===s;if(n.length===1&&t!==Infinity){C.log.warn(`Problem encountered with playlist ${s.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){if(this.main().contentSteering){const h=this.pathwayAttribute_(s);const f=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(h);this.excludeThenChangePathway_();setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(h)},f);return}let i=false;n.forEach(e=>{if(e===s){return}const t=e.excludeUntil;if(typeof t!=="undefined"&&t!==Infinity){i=true;delete e.excludeUntil}});if(i){C.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let a;if(s.playlistErrors_>this.maxPlaylistRetries){a=Infinity}else{a=Date.now()+t*1e3}s.excludeUntil=a;if(e.reason){s.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const l=e.internal?this.logger_:C.log.warn;const c=e.message?" "+e.message:"";l(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${s.id}.`+`${c} Switching to playlist ${o.id}.`);if(o.attributes.AUDIO!==s.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(o.attributes.SUBTITLES!==s.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5*1e3;const d=typeof o.lastRequest==="number"&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",r||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(i,e){const s=[];const t=i==="all";if(t||i==="main"){s.push(this.mainPlaylistLoader_)}const n=[];if(t||i==="audio"){n.push("AUDIO")}if(t||i==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;if(t){s.push(t)}});["main","audio","subtitle"].forEach(e=>{const t=this[`${e}SegmentLoader_`];if(t&&(i===e||i==="all")){s.push(t)}});s.forEach(t=>e.forEach(e=>{if(typeof t[e]==="function"){t[e]()}}))}setCurrentTime(e){const t=Ah(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(t&&t.length){return e}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause();this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause();this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const e=this.mainPlaylistLoader_.media();if(!e){return 0}if(!e.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return Yg.Playlist.duration(e)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_){return}let t=this.mainPlaylistLoader_.media();if(!t){return}let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=Yg.Playlist.seekable(t,i,Yg.Playlist.liveEdgeDelay(s,t));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){t=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}e=Yg.Playlist.seekable(t,i,Yg.Playlist.liveEdgeDelay(s,t));if(e.length===0){return}}let r;let a;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);a=this.seekable_.start(0)}if(!e){this.seekable_=n}else if(e.start(0)>n.end(0)||n.start(0)>e.end(0)){this.seekable_=n}else{this.seekable_=R([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)<n.end(0)?e.end(0):n.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===r&&this.seekable_.start(0)===a){return}}this.logger_(`seekable updated [${Ph(this.seekable_)}]`);const o={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:o});this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.updateDuration_=null}if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e);this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const e=this.seekable();if(!e.length){return}if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1)){this.sourceUpdater_.setDuration(e.end(e.length-1))}return}const t=this.tech_.buffered();let i=Yg.Playlist.duration(this.mainPlaylistLoader_.media());if(t.length>0){i=Math.max(i,t.end(t.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();this.contentSteeringController_.dispose();this.keyStatusMap_.clear();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t){t[i].forEach(e=>{if(e.playlistLoader){e.playlistLoader.dispose()}})}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_)}this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_);this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_);this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const t=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!e?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!t||!i){return false}return true}getCodecsOrExclude_(){const i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const s=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();i.video=i.main;const e=om(this.main(),s);const n={};const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo){n.video=e.video||i.main.videoCodec||Eo}if(i.main.isMuxed){n.video+=`,${e.audio||i.main.audioCodec||So}`}if(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||t){n.audio=e.audio||i.main.audioCodec||i.audio.audioCodec||So;i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4}if(!n.audio&&!n.video){this.excludePlaylist({playlistToExclude:s,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(e,t)=>e?bo(t):To(t);const a={};let o;["video","audio"].forEach(function(e){if(n.hasOwnProperty(e)&&!r(i[e].isFmp4,n[e])){const t=i[e].isFmp4?"browser":"muxer";a[t]=a[t]||[];a[t].push(n[e]);if(e==="audio"){o=t}}});if(t&&o&&s.attributes.AUDIO){const l=s.attributes.AUDIO;this.main().playlists.forEach(e=>{const t=e.attributes&&e.attributes.AUDIO;if(t===l&&e!==s){e.excludeUntil=Infinity}});this.logger_(`excluding audio group ${l} as ${o} does not support codec(s): "${n.audio}"`)}if(Object.keys(a).length){const c=Object.keys(a).reduce((e,t)=>{if(e){e+=", "}e+=`${t} does not support codec(s): "${a[t].join(",")}"`;return e},"")+".";this.excludePlaylist({playlistToExclude:s,error:{internal:true,message:c},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];["video","audio"].forEach(e=>{const t=(mo(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const i=(mo(n[e]||"")[0]||{}).type;if(t&&i&&t.toLowerCase()!==i.toLowerCase()){u.push(`"${this.sourceUpdater_.codecs[e]}" -> "${n[e]}"`)}});if(u.length){this.excludePlaylist({playlistToExclude:s,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return n}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const n=this.main().playlists;const r=[];Object.keys(n).forEach(e=>{const t=n[e];if(r.indexOf(t.id)!==-1){return}r.push(t.id);const i=om(this.main,t);const s=[];if(i.audio&&!To(i.audio)&&!bo(i.audio)){s.push(`audio codec ${i.audio}`)}if(i.video&&!To(i.video)&&!bo(i.video)){s.push(`video codec ${i.video}`)}if(i.text&&i.text==="stpp.ttml.im1t"){s.push(`text codec ${i.text}`)}if(s.length){t.excludeUntil=Infinity;this.logger_(`excluding ${t.id} for unsupported: ${s.join(", ")}`)}})}excludeIncompatibleVariants_(e){const o=[];const l=this.main().playlists;const t=rm(mo(e));const c=am(t);const u=t.video&&mo(t.video)[0]||null;const d=t.audio&&mo(t.audio)[0]||null;Object.keys(l).forEach(e=>{const t=l[e];if(o.indexOf(t.id)!==-1||t.excludeUntil===Infinity){return}o.push(t.id);const i=[];const s=om(this.mainPlaylistLoader_.main,t);const n=am(s);if(!s.audio&&!s.video){return}if(n!==c){i.push(`codec count "${n}" !== "${c}"`)}if(!this.sourceUpdater_.canChangeType()){const r=s.video&&mo(s.video)[0]||null;const a=s.audio&&mo(s.audio)[0]||null;if(r&&u&&r.type.toLowerCase()!==u.type.toLowerCase()){i.push(`video codec "${r.type}" !== "${u.type}"`)}if(a&&d&&a.type.toLowerCase()!==d.type.toLowerCase()){i.push(`audio codec "${a.type}" !== "${d.type}"`)}}if(i.length){t.excludeUntil=Infinity;this.logger_(`excluding ${t.id}: ${i.join(" && ")}`)}})}updateAdCues_(e){let t=0;const i=this.seekable();if(i.length){t=i.start(0)}vg(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime();const t=L.GOAL_BUFFER_LENGTH;const i=L.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(t,L.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime();const t=L.BUFFER_LOW_WATER_LINE;const i=L.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(t,L.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(t,L.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return L.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Am(this.inbandTextTracks_,"com.apple.streaming",this.tech_);km({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Am(this.inbandTextTracks_,e,this.tech_);wm({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(!e.contentSteering){return}for(const t of e.playlists){this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t))}this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering);if(this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(true);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways();this.contentSteeringController_.dispose();this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));const e=["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];e.forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(y({},e))})});if(this.sourceType_==="dash"){this.mainPlaylistLoader_.on("loadedplaylist",()=>{const n=this.main();const e=this.contentSteeringController_.didDASHTagChange(n.uri,n.contentSteering);const t=()=>{const e=this.contentSteeringController_.getAvailablePathways();const t=[];for(const i of n.playlists){const s=i.attributes.serviceLocation;if(s){t.push(s);if(!e.has(s)){return true}}}if(!t.length&&e.size){return true}return false};if(e||t()){this.resetContentSteeringController_()}})}}excludeThenChangePathway_(){const o=this.contentSteeringController_.getPathway();if(!o){return}this.handlePathwayClones_();const e=this.main();const l=e.playlists;const c=new Set;let u=false;Object.keys(l).forEach(e=>{const t=l[e];const i=this.pathwayAttribute_(t);const s=i&&o!==i;const n=t.excludeUntil===Infinity&&t.lastExcludeReason_==="content-steering";if(n&&!s){delete t.excludeUntil;delete t.lastExcludeReason_;u=true}const r=!t.excludeUntil&&t.excludeUntil!==Infinity;const a=!c.has(t.id)&&s&&r;if(!a){return}c.add(t.id);t.excludeUntil=Infinity;t.lastExcludeReason_="content-steering";this.logger_(`excluding ${t.id} for ${t.lastExcludeReason_}`)});if(this.contentSteeringController_.manifestType_==="DASH"){Object.keys(this.mediaTypes_).forEach(e=>{const t=this.mediaTypes_[e];if(t.activePlaylistLoader){const i=t.activePlaylistLoader.media_;if(i&&i.attributes.serviceLocation!==o){u=true}}})}if(u){this.changeSegmentPathway_()}}handlePathwayClones_(){const e=this.main();const t=e.playlists;const i=this.contentSteeringController_.currentPathwayClones;const s=this.contentSteeringController_.nextPathwayClones;const n=i&&i.size||s&&s.size;if(!n){return}for(const[r,a]of i.entries()){const o=s.get(r);if(!o){this.mainPlaylistLoader_.updateOrDeleteClone(a);this.contentSteeringController_.excludePathway(r)}}for(const[r,a]of s.entries()){const l=i.get(r);if(!l){const c=t.filter(e=>{return e.attributes["PATHWAY-ID"]===a["BASE-ID"]});c.forEach(e=>{this.mainPlaylistLoader_.addClonePathway(a,e)});this.contentSteeringController_.addAvailablePathway(r);continue}if(this.equalPathwayClones_(l,a)){continue}this.mainPlaylistLoader_.updateOrDeleteClone(a,true);this.contentSteeringController_.addAvailablePathway(r)}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST){return false}const i=e["URI-REPLACEMENT"].PARAMS;const s=t["URI-REPLACEMENT"].PARAMS;for(const n in i){if(i[n]!==s[n]){return false}}for(const n in s){if(i[n]!==s[n]){return false}}return true}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading();if(this.contentSteeringController_.manifestType_==="DASH"){this.switchMediaForDASHContentSteering_()}this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main){return}let r=0;const a="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const e=this.mainPlaylistLoader_.getKeyIdSet(n);if(!e||!e.size){return}e.forEach(e=>{const t="usable";const i=this.keyStatusMap_.has(e)&&this.keyStatusMap_.get(e)===t;const s=n.lastExcludeReason_===a&&n.excludeUntil===Infinity;if(!i){if(n.excludeUntil!==Infinity&&n.lastExcludeReason_!==a){n.excludeUntil=Infinity;n.lastExcludeReason_=a;this.logger_(`excluding playlist ${n.id} because the key ID ${e} doesn't exist in the keyStatusMap or is not ${t}`)}r++}else if(i&&s){delete n.excludeUntil;delete n.lastExcludeReason_;this.logger_(`enabling playlist ${n.id} because key ID ${e} is ${t}`)}})});if(r>=this.mainPlaylistLoader_.main.playlists.length){this.mainPlaylistLoader_.main.playlists.forEach(e=>{const t=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720;const i=e.excludeUntil===Infinity&&e.lastExcludeReason_===a;if(t&&i){delete e.excludeUntil;C.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${a} key IDs`)}})}}addKeyStatus_(e,t){const i=typeof e==="string";const s=i?e:pg(e);const n=s.slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`);this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t);if(!this.waitingForFastQualityPlaylistReceived_){this.excludeNonUsableThenChangePlaylist_()}this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this));this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_();this.fastQualityChange_()}}const Zg=(r,a,o)=>e=>{const t=r.main.playlists[a];const i=Jh(t);const s=Zh(t);if(typeof e==="undefined"){return s}if(e){delete t.disabled}else{t.disabled=true}const n={renditionInfo:{id:a,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};if(e!==s&&!i){o(t);if(e){r.trigger({type:"renditionenabled",metadata:n})}else{r.trigger({type:"renditiondisabled",metadata:n})}}return e};class ey{constructor(e,t,i){const{playlistController_:s}=e;const n=s.fastQualityChange_.bind(s);if(t.attributes){const r=t.attributes.RESOLUTION;this.width=r&&r.width;this.height=r&&r.height;this.bandwidth=t.attributes.BANDWIDTH;this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=om(s.main(),t);this.playlist=t;this.id=i;this.enabled=Zg(e.playlists,t.id,n)}}const ty=function(i){i.representations=()=>{const e=i.playlistController_.main();const t=lf(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!t){return[]}return t.filter(e=>!Jh(e)).map((e,t)=>new ey(i,e,e.id))}};const iy=["seeking","seeked","pause","playing","error"];class sy extends C.EventTarget{constructor(e){super();this.playlistController_=e.playlistController;this.tech_=e.tech;this.seekable=e.seekable;this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta;this.media=e.media;this.playedRanges_=[];this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=Eh("PlaybackWatcher");this.logger_("initialize");const t=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const s=()=>this.techWaiting_();const n=()=>this.resetTimeUpdate_();const r=this.playlistController_;const a=["main","subtitle","audio"];const o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)};r[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend);r[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset);this.tech_.on(["seeked","seeking"],o[e].reset)});const l=t=>{["main","audio"].forEach(e=>{r[`${e}SegmentLoader_`][t]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();l("off")}};this.clearSeekingAppendCheck_=()=>l("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();l("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",s);this.tech_.on(iy,n);this.tech_.on("canplay",i);this.tech_.one("play",t);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",s);this.tech_.off(iy,n);this.tech_.off("canplay",i);this.tech_.off("play",t);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);a.forEach(e=>{r[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend);r[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset);this.tech_.off(["seeked","seeking"],o[e].reset)});if(this.checkCurrentTimeTimeout_){Ly.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){Ly.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=Ly.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];if(this[`${e}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${e} loader`)}this[`${e}StalledDownloads_`]=0;this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_;const i=t[`${e}SegmentLoader_`];const s=i.buffered_();const n=Nh(this[`${e}Buffered_`],s);this[`${e}Buffered_`]=s;if(n){const r={bufferedRanges:s};t.trigger({type:"bufferedrangeschanged",metadata:r});this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++;this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Lh(s)});if(this[`${e}StalledDownloads_`]<10){return}this.logger_(`${e} loader stalled download exclusion`);this.resetSegmentDownloads_(e);this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`});if(e==="subtitle"){return}t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const e=this.tech_.currentTime();const t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ch>=t.end(t.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(e===this.lastRecordedTime){this.consecutiveUpdates++}else{this.playedRanges_.push(R([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i});this.consecutiveUpdates=0;this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e){return false}const t=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const f=t.end(t.length-1);n=f}if(this.beforeSeekableWindow_(t,i)){const p=t.start(0);n=p+(p===t.end(0)?0:Ch)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${Ph(t)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const a=this.tech_.buffered();const o=r.audioBuffer?r.audioBuffered():null;const l=r.videoBuffer?r.videoBuffered():null;const c=this.media();const u=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-Ih)*2;const d=[o,l];for(let e=0;e<d.length;e++){if(!d[e]){continue}const m=Uh(d[e],i);if(m<u){return false}}const h=Dh(a,i);if(h.length===0){return false}n=h.start(0)+Ch;this.logger_(`Buffered region starts (${h.start(0)}) `+` just beyond seek point (${i}). Seeking to ${n}.`);this.tech_.setCurrentTime(n);return true}waiting_(){if(this.techWaiting_()){return}const e=this.tech_.currentTime();const t=this.tech_.buffered();const i=Ah(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_();this.tech_.setCurrentTime(e);this.logger_(`Stopped at ${e} while inside a buffered region `+`[${i.start(0)} -> ${i.end(0)}]. Attempting to resume `+"playback by seeking to the current time.");this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable();const t=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);this.logger_(`Fell out of live window at time ${t}. Seeking to `+`live point (seekable end) ${a}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(a);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const s=this.tech_.buffered();const n=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=Dh(s,t);if(r.length>0){this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(t);return true}return false}afterSeekableWindow_(e,t,i,s=false){if(!e.length){return false}let n=e.end(e.length-1)+Ch;const r=!i.endList;const a=typeof i.partTargetDuration==="number";if(r&&(a||s)){n=e.end(e.length-1)+i.targetDuration*3}if(t>n){return true}return false}beforeSeekableWindow_(e,t){if(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta){return true}return false}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e){return}let s;if(e.length&&t.length){const n=Ah(e,i-3);const r=Ah(e,i);const a=Ah(t,i);if(a.length&&!r.length&&n.length){s={start:n.end(0),end:a.end(0)}}}else{const o=Dh(e,i);if(!o.length){s=this.gapFromVideoUnderflow_(e,i)}}if(s){this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. `+`Seeking to current time ${i}`);return true}return false}skipTheGap_(e){const t=this.tech_.buffered();const i=this.tech_.currentTime();const s=Dh(t,i);this.resetTimeUpdate_();if(s.length===0||i!==e){return}this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",s.start(0));this.tech_.setCurrentTime(s.start(0)+Ih);const n={gapInfo:{from:i,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n});this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=xh(e);for(let e=0;e<i.length;e++){const s=i.start(e);const n=i.end(e);if(t-s<4&&t-s>2){return{start:s,end:n}}}return null}}const ny={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:true});const i=t.currentSource_||this.currentSource();return e(i)}};const ry=function(t,e){let i=0;let s=0;const n=M(ny,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){if(s){t.currentTime(s)}};const a=function(e){if(e===null||e===undefined){return}s=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",r);t.src(e);t.trigger({type:"usage",name:"vhs-error-reload"});t.play()};const o=function(){if(Date.now()-i<n.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!=="function"){C.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}i=Date.now();return n.getSource.call(t,a)};const l=function(){t.off("loadedmetadata",r);t.off("error",o);t.off("dispose",l)};const c=function(e){l();ry(t,e)};t.on("error",o);t.on("dispose",l);t.reloadSourceOnError=c};const ay=function(e){ry(this,e)};var oy="3.13.3";var ly="7.0.3";var cy="1.3.0";var uy="7.1.0";var dy="4.0.1";const a={PlaylistLoader:Rf,Playlist:cf,utils:Xf,STANDARD_PLAYLIST_SELECTOR:mm,INITIAL_PLAYLIST_SELECTOR:_m,lastBandwidthSelector:mm,movingAverageBandwidthSelector:gm,comparePlaylistBandwidth:hm,comparePlaylistResolution:fm,xhr:Uf()};Object.keys(L).forEach(t=>{Object.defineProperty(a,t,{get(){C.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return L[t]},set(e){C.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){C.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}L[t]=e}})});const hy="videojs-vhs";const fy=function(t,e){const i=e.media();let s=-1;for(let e=0;e<t.length;e++){if(t[e].id===i.id){s=e;break}}t.selectedIndex_=s;t.trigger({selectedIndex:s,type:"change"})};const py=function(t,e){e.representations().forEach(e=>{t.addQualityLevel(e)});fy(t,e.playlists)};a.canPlaySource=function(){return C.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const my=(e,t,i)=>{if(!e){return e}let s={};if(t&&t.attributes&&t.attributes.CODECS){s=rm(mo(t.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=vo(s.video);const r=vo(s.audio);const a={};for(const o in e){a[o]={};if(r){a[o].audioContentType=r}if(n){a[o].videoContentType=n}if(t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh){a[o].pssh=t.contentProtection[o].pssh}if(typeof e[o]==="string"){a[o].url=e[o]}}return M(e,a)};const gy=(e,i)=>{return e.reduce((e,s)=>{if(!s.contentProtection){return e}const t=i.reduce((e,t)=>{const i=s.contentProtection[t];if(i&&i.pssh){e[t]={pssh:i.pssh}}return e},{});if(Object.keys(t).length){e.push(t)}return e},[])};const yy=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys){return Promise.resolve()}const n=t?i.concat([t]):i;const r=gy(n,Object.keys(e));const a=[];const o=[];r.forEach(e=>{o.push(new Promise((e,t)=>{s.tech_.one("keysessioncreated",e)}));a.push(new Promise((t,i)=>{s.eme.initializeMediaKeys({keySystems:e},e=>{if(e){i(e);return}t()})}))});return Promise.race([Promise.all(a),Promise.race(o)])};const _y=({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{const n=my(t,i,s);if(!n){return false}e.currentSource().keySystems=n;if(n&&!e.eme){C.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const vy=()=>{if(!Ly.localStorage){return null}const e=Ly.localStorage.getItem(hy);if(!e){return null}try{return JSON.parse(e)}catch(e){return null}};const by=e=>{if(!Ly.localStorage){return false}let t=vy();t=t?M(t,e):e;try{Ly.localStorage.setItem(hy,JSON.stringify(t))}catch(e){return false}return t};const Ty=e=>{if(e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(e.substring(e.indexOf(",")+1))}return e};const Sy=(e,t)=>{if(!e._requestCallbackSet){e._requestCallbackSet=new Set}e._requestCallbackSet.add(t)};const Ey=(e,t)=>{if(!e._responseCallbackSet){e._responseCallbackSet=new Set}e._responseCallbackSet.add(t)};const wy=(e,t)=>{if(!e._requestCallbackSet){return}e._requestCallbackSet.delete(t);if(!e._requestCallbackSet.size){delete e._requestCallbackSet}};const Iy=(e,t)=>{if(!e._responseCallbackSet){return}e._responseCallbackSet.delete(t);if(!e._responseCallbackSet.size){delete e._responseCallbackSet}};a.supportsNativeHls=function(){if(!Ny||!Ny.createElement){return false}const t=Ny.createElement("video");if(!C.getTech("Html5").isSupported()){return false}const e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(e){return/maybe|probably/i.test(t.canPlayType(e))})}();a.supportsNativeDash=function(){if(!Ny||!Ny.createElement||!C.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(Ny.createElement("video").canPlayType("application/dash+xml"))}();a.supportsTypeNatively=e=>{if(e==="hls"){return a.supportsNativeHls}if(e==="dash"){return a.supportsNativeDash}return false};a.isSupported=function(){return C.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};a.xhr.onRequest=function(e){Sy(a.xhr,e)};a.xhr.onResponse=function(e){Ey(a.xhr,e)};a.xhr.offRequest=function(e){wy(a.xhr,e)};a.xhr.offResponse=function(e){Iy(a.xhr,e)};const Cy=C.getComponent("Component");class ky extends Cy{constructor(e,t,i){super(t,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=Eh("VhsHandler");if(t.options_&&t.options_.playerId){const s=C.getPlayer(t.options_.playerId);this.player_=s}this.tech_=t;this.source_=e;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks){t.overrideNativeAudioTracks(true);t.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(Ny,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=Ny.fullscreenElement||Ny.webkitFullscreenElement||Ny.mozFullScreenElement||Ny.msFullscreenElement;if(t&&t.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}});this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())});this.on(this.tech_,"error",function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}});this.on(this.tech_,"play",this.play)}setOptions_(e={}){this.options_=M(this.options_,e);this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const i=vy();if(i&&i.bandwidth){this.options_.bandwidth=i.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(i&&i.throughput){this.options_.throughput=i.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=L.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===L.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{if(typeof this.source_[e]!=="undefined"){this.options_[e]=this.source_[e]}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;if(typeof t==="number"&&t>=0){this.customPixelRatio=t}}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e){return}this.setOptions_();this.options_.src=Ty(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=a;this.options_.sourceType=Co(t);this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)};this.options_.player_=this.player_;this.playlistController_=new Jg(this.options_);const i=M({liveRangeSafeTimeDelta:Ch},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new sy(i);this.attachStreamingEventListeners_();this.playlistController_.on("error",()=>{const e=C.players[this.tech_.options_.playerId];let t=this.playlistController_.error;if(typeof t==="object"&&!t.code){t.code=3}else if(typeof t==="string"){t={message:t,code:3}}e.error(t)});const s=this.options_.bufferBasedABR?a.movingAverageBandwidthSelector(.55):a.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this);this.playlistController_.selectInitialPlaylist=a.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.playlistController_.mainPlaylistLoader_;this.mediaSource=this.playlistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=Ly.navigator.connection||Ly.navigator.mozConnection||Ly.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&t){const s=t.downlink*1e3*1e3;if(s>=i&&e>=i){e=Math.max(e,s)}else{e=s}}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;if(this.throughput>0){t=1/this.throughput}else{t=0}const i=Math.floor(1/(e+t));return i},set(){C.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>Lh(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>Lh(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",()=>{if(this.options_.useBandwidthFromLocalStorage){by({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}});this.playlistController_.on("selectedinitialmedia",()=>{ty(this)});this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()});this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")});this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=true});this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=Ly.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");yy({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e);this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const t=_y({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)});this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=C.players[this.tech_.options_.playerId];if(!e||!e.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=e.qualityLevels();this.playlistController_.on("selectedinitialmedia",()=>{py(this.qualityLevels_,this)});this.playlists.on("mediachange",()=>{fy(this.qualityLevels_,this.playlists)})}static version(){return{"@videojs/http-streaming":oy,"mux.js":ly,"mpd-parser":cy,"m3u8-parser":uy,"aes-decrypter":dy}}version(){return this.constructor.version()}canChangeType(){return hg.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&Ly.URL.revokeObjectURL){Ly.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(e,t){return sp({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=true,s=2){return np({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Sy(this.xhr,e)};this.xhr.onResponse=e=>{Ey(this.xhr,e)};this.xhr.offRequest=e=>{wy(this.xhr,e)};this.xhr.offResponse=e=>{Iy(this.xhr,e)};this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];const t=["gapjumped","playedrangeschanged"];e.forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(y({},e))})});t.forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(y({},e))})})}}const Ay={name:"videojs-http-streaming",VERSION:oy,canHandleSource(e,t={}){const i=M(C.options,t);return Ay.canPlayType(e.type,i)},handleSource(e,t,i={}){const s=M(C.options,i);t.vhs=new ky(e,t,s);t.vhs.xhr=Uf();t.vhs.setupXhrHooks_();t.vhs.src(e.src,e.type);return t.vhs},canPlayType(e,t){const i=Co(e);if(!i){return""}const s=Ay.getOverrideNative(t);const n=a.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e;const i=!(C.browser.IS_ANY_SAFARI||C.browser.IS_IOS);const{overrideNative:s=i}=t;return s}};const Dy=()=>{return bo("avc1.4d400d,mp4a.40.2")};if(Dy()){C.getTech("Html5").registerSourceHandler(Ay,0)}C.VhsHandler=ky;C.VhsSourceHandler=Ay;C.Vhs=a;if(!C.use){C.registerComponent("Vhs",a)}C.options.vhs=C.options.vhs||{};if(!C.getPlugin||!C.getPlugin("reloadSourceOnError")){C.registerPlugin("reloadSourceOnError",ay)}return C})})(qe);var je=qe.exports;var v=Fe(je);var D="2.22.0";function w(){w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)){e[s]=i[s]}}}return e};return w.apply(this,arguments)}var Ve=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"});var $e=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function He(e){return Object.assign({muted:false,timeout:250,inline:false},e)}function Ge(e,t){var i=e.muted,n=e.timeout,s=e.inline;var r=t(),a=r.element,o=r.source;var l=void 0;var c=void 0;var u=void 0;a.muted=i;if(i===true){a.setAttribute("muted","muted")}if(s===true){a.setAttribute("playsinline","playsinline")}a.src=o;return new Promise(function(s){l=a.play();c=setTimeout(function(){u(false,new Error("Timeout "+n+" ms has been reached"))},n);u=function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;a.remove();a.srcObject=null;clearTimeout(c);s({result:t,error:i})};if(l!==undefined){l.then(function(){return u(true)}).catch(function(e){return u(false,e)})}else{u(true)}})}function ze(e){e=He(e);return Ge(e,function(){return{element:Ny.createElement("video"),source:URL.createObjectURL($e)}})}function We(e){e=He(e);return Ge(e,function(){return{element:Ny.createElement("audio"),source:URL.createObjectURL(Ve)}})}var Ye={audio:We,video:ze};const Xe=[{inline:false,muted:false},{inline:true,muted:false},{inline:false,muted:true},{inline:true,muted:true}];function Ke(e){const t=e.filter(e=>e.passed)[0];if(!t){return{always:false,sometimes:false,never:true,inline:false,muted:false}}const{inline:i,muted:s}=t;const n=!i&&!s;return{always:n,sometimes:!n,never:false,inline:i,muted:s}}function Qe(e){let t;if(Ly.cast&&Ly.cast.receiver){t={always:true,sometimes:false,never:false,inline:false,muted:false}}if(e.ANDROID_VERSION||e.IS_IOS){t={always:false,sometimes:true,never:false,inline:false,muted:true};if(e.IS_IPHONE){t.inline=true}}if(t){return Promise.resolve(t)}}function Je(e,t){if(e!=="video"&&e!=="audio"){throw new Error(`invalid autoplay type: ${e}`)}const i=Qe(t.browser);if(i){return i}const s=Xe.map(t=>{return Ye[e](t).then(({result:e})=>{return w({passed:e},t)})});return Promise.all(s).then(e=>{return Ke(e)})}const Ze=Ly.performance;const et={};["memory","navigation","timing"].forEach(e=>{et[e]=Ze&&Ze[e]||{}});["clearMarks","clearMeasures","clearResourceTimings","getEntries","getEntriesByName","getEntriesByType","mark","measure","now","setResourceTimingBufferSize","toJSON"].forEach(t=>{et[t]=(...e)=>{if(Ze&&Ze[t]){return Ze[t](...e)}}});function tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var it=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function st(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function nt(i,s,n,e){s=s||"&";n=n||"=";if(i===null){i=undefined}if(typeof i==="object"){return rt(at(i),function(e){var t=encodeURIComponent(st(e))+n;if(it(i[e])){return rt(i[e],function(e){return t+encodeURIComponent(st(e))}).join(s)}else{return t+encodeURIComponent(st(i[e]))}}).join(s)}if(!e)return"";return encodeURIComponent(st(e))+n+encodeURIComponent(st(i))}function rt(e,t){if(e.map)return e.map(t);var i=[];for(var s=0;s<e.length;s++){i.push(t(e[s],s))}return i}var at=Object.keys||function(e){var t=[];for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i))t.push(i)}return t};function ot(e,t,i,s){t=t||"&";i=i||"=";var n={};if(typeof e!=="string"||e.length===0){return n}var r=/\+/g;e=e.split(t);var a=1e3;if(s&&typeof s.maxKeys==="number"){a=s.maxKeys}var o=e.length;if(a>0&&o>a){o=a}for(var l=0;l<o;++l){var c=e[l].replace(r,"%20"),u=c.indexOf(i),d,h,f,p;if(u>=0){d=c.substr(0,u);h=c.substr(u+1)}else{d=c;h=""}f=decodeURIComponent(d);p=decodeURIComponent(h);if(!tt(n,f)){n[f]=p}else if(it(n[f])){n[f].push(p)}else{n[f]=[n[f],p]}}return n}var lt={encode:nt,stringify:nt,decode:ot,parse:ot};function ct(e=Ly&&Ly.location||{}){let t;let i;try{t=lt.parse((e.hash||"#").substr(1))}catch(e){t={}}try{i=lt.parse((e.search||"?").substr(1))}catch(e){i={}}return w({hash:t,search:i},lt)}function ut(e){return Array.isArray(e)}function x(e){return typeof e==="function"}function k(e){return e===null||e===undefined}function dt(e){return typeof e==="number"&&e===e}function O(e){return typeof e==="string"&&/\S/.test(e)}function ht(e){return Object.prototype.toString.call(e)==="[object Object]"}var ft=Object.freeze({__proto__:null,isArr:ut,isFn:x,isNil:k,isNonEmptyStr:O,isNum:dt,isObj:ht});function pt(i,s){let n=Date.now();return function(...e){const t=Date.now();if(t-n>=s){i(...e);n=t}}}function mt(s,n,r,a=Ly){let o;return function(){const e=this;const t=arguments;let i=function(){o=null;i=null;if(!r){s.apply(e,t)}};if(!o&&r){s.apply(e,t)}a.clearTimeout(o);o=a.setTimeout(i,n)}}var gt=Object.freeze({__proto__:null,debounce:mt,throttle:pt});const yt=(e,t)=>{if(e){const i=Number(e.substring(0,e.indexOf(".")));if(i){return i>=t}v.log.warn("Plugin VERSION string format does not conform to semantic versioning standards and cannot be checked.")}return false};const _t=e=>{return e==="application/vnd.apple.mpegurl"||e==="application/x-mpegURL"};const vt=(e,t)=>{const i=e&&e.encryption&&e.encryption.method;if(typeof i==="string"){return i.toLowerCase()==="aes-128"}const s=t.url.parseUrl(e.src);return s.hostname.indexOf("boltdns.net")!==-1&&s.pathname.indexOf("/aes128/")!==-1};const bt=(t,e)=>{const i=["audio","video"];let s;for(let e=0;e<i.length&&!s;e++){const n=i[e];if(t.includes(n)){s=n}}if(!s){s=e?i[0]:i[1]}return s};var Tt=Object.freeze({__proto__:null,getSimpleType:bt,isEncryptedHls:vt,isHlsType:_t});const St=e=>{const{mediainfo:t,liveTracker:i}=e;const s=t&&t.duration||e.duration();return i&&i.isLive()||s===Infinity};var Et=Object.freeze({__proto__:null,isLive:St});const wt=()=>{const e=Ly.GestureEvent;return!!(e&&Ly.WebKitMediaKeys&&Ly.WebKitMediaKeys.isTypeSupported("com.apple.fps.1_0","video/mp4"))};const It=e=>{return e.browser.IS_EDGE&&/Chrome/i.test(Ly.navigator.userAgent)};const Ct=e=>{return Ly.navigator.requestMediaKeySystemAccess&&!e.browser.IS_IOS&&(e.browser.IS_FIREFOX||e.browser.IS_CHROME||It(e))};const kt=e=>{return Ly.SourceBuffer&&Ly.SourceBuffer.prototype&&typeof Ly.SourceBuffer.prototype.changeType==="function"};const At=()=>{return Ly.MediaSource&&Ly.MediaSource.isTypeSupported&&Ly.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.90"')};const Dt=e=>{return e.isSecureContext||!/^http:/.test(e.location.href)};let xt;const Ot=()=>{xt=undefined};const Pt=e=>{if(xt!==undefined){return xt}const t=Ny.createElement("video");const i=e.options.hls&&e.options.hls.overrideNative;if(t&&t.canPlayType){xt=!i&&/probably|maybe/i.test(t.canPlayType("application/vnd.apple.mpegurl"))}else{xt=false}return xt};const Rt=e=>{xt=e};var Lt=Object.freeze({__proto__:null,clearCachedIsNativeHlsSupported:Ot,isBrowserWithWidevineSupport:Ct,isChromiumEdge:It,isCodecSwitchingSupported:kt,isHevcSupported:At,isNativeHlsSupported:Pt,isSafariWithFairplaySupport:wt,mockCachedIsNativeHlsSupported:Rt,preferHttps:Dt});function Nt(o,e){const{xhr:t}=e;return new Promise((r,a)=>{t(o,(e,t)=>{if(e||t.statusCode!==200||!t.body){const i=t.statusCode||"";const s=e&&e.message?e.message:"";const n=new Error(`downloadManifest: xhr for manifest at ${o} failed ${i?"with status: "+i:""} ${s}.`);return a(n)}r(t.body)})})}function Mt(e,t){const i=new t;i.push(e);i.end();return i.manifest}var Ut=Object.freeze({__proto__:null,downloadManifest:Nt,parseHlsManifest:Mt});function Bt(e,a,o){const l={};class t{constructor(){Object.values(l).forEach(e=>{this.manageProperty(e)})}reset(){Object.getOwnPropertyNames(l).forEach(e=>{l[e].value.set(this,undefined)})}manageProperty(e){const t=e&&e.name;const i=e&&e.validation;const s=i&&i.validator;const n=i&&i.message;let r;if(!t||!i||!s||!n){throw new Error("unable to add managed property",e)}if(l.hasOwnProperty(t)&&typeof Object.getOwnPropertyDescriptor(this,t)!=="undefined"){if(o){o.log.warn(`property ${t} is already managed`)}return}if(typeof l[t]==="undefined"){l[t]=w(e,{value:new WeakMap})}if(this.hasOwnProperty(t)){r=this[t];delete this[t]}Object.defineProperty(this,t,{get:()=>l[t].value.get(this),set:e=>{if(s(e)){l[t].value.set(this,e);return}throw new Error(`could not set ${t} to ${e}: ${n}`)},enumerable:true});if(a){Object.defineProperty(this,`${a}${t}`,{get:()=>this[t],enumerable:true})}if(typeof r!=="undefined"){this[t]=r}}}if(!Array.isArray(e)||!e.length){throw new Error("ManagedDataStore needs to be initialised with properties to manage")}e.forEach(e=>{l[e.name]=w(e,{value:new WeakMap})});return new t}var Ft=Object.freeze({__proto__:null,managedDataStore:Bt});function qt(t){let i=t;if(ut(t)){i=t.filter(e=>!k(e)).map(qt)}else if(ht(t)){i={};Object.keys(t).forEach(e=>{if(!k(t[e])){i[e]=qt(t[e])}})}return i}const W={perf:et,qs:ct,isValidVersion:yt,assign(...e){return w(...e)},get(e,t,i){let s=e;const n=t.split(".");if(!s){return i}for(let e=0;e<n.length;e++){const r=n[e];if(s[r]===undefined){return i}if(e+1<n.length){s=s[r]}else{return s[r]}}},withoutNilValues:qt};W.assign(W,ft,gt,Tt,Et,Lt,Ut,Ft);W.VERSION="n/a";const jt="bc-style-vjs";function Vt(e,t,i){const{classNames:s}=e;if(!t&&!i&&t!==0&&i!==0){return}let n=Ny.querySelector("."+s.playerInstanceDimensions);if(!n){n=Ny.createElement("style");n.className=s.playerInstanceDimensions;const d=Ny.querySelector("."+s.playerStyle)||Ny.querySelector("."+jt);if(d){d.parentNode.insertBefore(n,d.nextSibling)}else{Ny.head.appendChild(n)}}else if(n.innerText){if(!t&&t!==0){const h=/width:(\d+)px;/g.exec(n.innerText);if(h&&h[1]){t=Ly.parseInt(h[1],10)}}else if(!i&&i!==0){const h=/height:(\d+)px;/g.exec(n.innerText);if(h&&h[1]){i=Ly.parseInt(h[1],10)}}}let r;let a;let o="";let l="";let c="";if(t||t===0){r=Ly.parseInt(t,10);o=`width:${r}px;`}if(i||i===0){a=Ly.parseInt(i,10);l=`height:${a}px;`}const u=o||l?`.${s.playerInstance}{${o}${l}}`:"";if(t&&i){const f=".vjs-fluid:not(.vjs-audio-only-mode)";const p=`padding-top:${a/r*100}%;`;c=`.${s.playerInstance}${f}{${p}}`}n.innerText=`${u}${c}`}const $t=3;const Ht=50;const Gt=t=>{const i=Ny.body;const s=Ny.createElement("div");s.className="ads ad adsbox doubleclick ad-placement carbon-ads adglare pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text_ads_2 text-ads text-ad-links";s.innerHTML=" ";s.setAttribute("style","height:10px!important;font-size:20px;color:transparent;position:fixed;bottom:0;left:-10000px");let n=0;const r=()=>{n++;const e=s.offsetHeight===0||!i.contains(s)||s.style.display==="none"||s.style.visibility==="hidden";if(e||n===$t){if(s.parentNode){s.parentNode.removeChild(s)}return t(e)}Ly.setTimeout(r,Ht)};i.appendChild(s);r()};let zt=null;let Wt;function Yt(e){if(e||!Wt){Wt=new Promise(e=>{if(Ny.readyState==="complete"||Ny.readyState!=="loading"&&!Ny.documentElement.doScroll){Gt(e)}else{Ny.addEventListener("DOMContentLoaded",()=>{Gt(e)})}})}return Wt.then(e=>{zt=e;return e})}Object.defineProperties(Yt,{VERSION:{enumerable:true,value:"n/a"},lastResult:{enumerable:true,get(){return zt}},mightBe:{enumerable:true,get(){return zt!==false}},mightNotBe:{enumerable:true,get(){return zt!==true}}});const Xt="vjs-waiting-for-autoplay";function Kt(e,t,i,s){return e.hasAttribute("data-debug")||t.debug!==undefined||i.debug||s.debug}function Qt(t,e,i,s){const{settings:n,environment:r}=e;const{embedId:a,playerId:o}=n;const{isInBcFrame:l,queryString:c,urlHash:u}=r;const d=`bc-player-${o}_${a}`;const h=`${d}-index-${n.playerIndex}`;W.perf.mark("bcInitStart");n.classNames={player:d,playerStyle:`bc-style-${o}-${a}`,playerInstance:h,playerInstanceDimensions:`${h}-video-dimensions`};n.embedState={controls:i.hasAttribute("controls")||i.hasAttribute("data-controls"),loop:i.hasAttribute("loop"),muted:i.hasAttribute("muted"),playsinline:i.hasAttribute("playsinline"),poster:i.hasAttribute("poster"),sources:!!i.querySelector("source"),tracks:!!i.querySelector("track")};s.debug=Kt(i,c,s,n);if(i.hasAttribute("data-vttjs")&&W.isNonEmptyStr(i.getAttribute("data-vttjs"))){s["vtt.js"]=i.getAttribute("data-vttjs")}else if(c.vttjs&&W.isNonEmptyStr(c.vttjs)){s["vtt.js"]=c.vttjs}else if(s.hasOwnProperty("vtt.js")||s.hasOwnProperty("vttjs")){s["vtt.js"]=s["vtt.js"]||s.vttjs}else if(n["vtt.js"]||n.vttjs){s["vtt.js"]=n["vtt.js"]||n.vttjs}else{s["vtt.js"]="https://players.brightcove.net/videojs-vtt.js/0.15.4/vtt.global.min.js"}if(n.playButton){const{hover:I,shape:C,position:k}=n.playButton;if(I==="glow"){t.dom.addClass(i,"vjs-play-button-hover-glow")}else if(I==="darken"){t.dom.addClass(i,"vjs-play-button-hover-darken")}if(C==="square"){t.dom.addClass(i,"vjs-play-button-shape-square")}else if(C==="rectangle"){t.dom.addClass(i,"vjs-play-button-shape-rectangle")}if(k==="topRight"){t.dom.addClass(i,"vjs-play-button-position-top-right")}else if(k==="topLeft"){t.dom.addClass(i,"vjs-play-button-position-top-left")}}if(c.crossorigin!==undefined||n.media&&n.media.tracks&&t.browser.IS_ANY_SAFARI){n.crossorigin=true}if(n.crossorigin){i.setAttribute("crossorigin","anonymous")}if(n.audioPosterMode){s.audioPosterMode=n.audioPosterMode}if(n.audioOnlyMode){s.audioOnlyMode=n.audioOnlyMode}const f=u.t||c.t||i.getAttribute("data-start-time");if(/^[\d]+$/.test(f)){n.startTime=Number(f)}else if(/^(\d+h)?(\d+m)?(\d+s)?$/.test(f)){n.startTime=f}const p=c.adConfigId;const m=i.getAttribute("data-ad-config-id");if(W.isNonEmptyStr(p)){n.adConfigId=p}else if(W.isNonEmptyStr(m)){n.adConfigId=m}if(typeof n.adConfigId==="string"){n.adConfigId=n.adConfigId.trim()}if(!W.isNonEmptyStr(n.adConfigId)){n.adConfigId=null}if(n.usingAdFailover&&!Yt.mightBe){n.adConfigId=null}const g=c.deliveryConfigId;const y=i.getAttribute("data-delivery-config-id");if(W.isNonEmptyStr(g)){n.deliveryConfigId=g}else if(W.isNonEmptyStr(y)){n.deliveryConfigId=y}if(typeof n.deliveryConfigId==="string"){n.deliveryConfigId=n.deliveryConfigId.trim()}if(!W.isNonEmptyStr(n.deliveryConfigId)){n.deliveryConfigId=null}n.applicationId=c.applicationId||i.getAttribute("data-application-id")||n.applicationId;const _=W.qs();if(i.hasAttribute("autoplay")){s.autoplay=true}else if(l&&_.search.hasOwnProperty("autoplay")){if(_.search.autoplay==="true"||!_.search.autoplay){s.autoplay=true}else if(_.search.autoplay==="false"){s.autoplay=false}else{s.autoplay=_.search.autoplay}}else if(!s.hasOwnProperty("autoplay")){s.autoplay=n.autoplay||false}if(s.autoplay){t.dom.addClass(i,Xt)}if(c.preload){s.preload=c.preload}else if(!s.hasOwnProperty("preload")&&n.preload){s.preload=n.preload}s.height=i.getAttribute("height")||undefined;s.width=i.getAttribute("width")||undefined;if(!l&&i&&(s.width||s.height)){Vt(n,s.width,s.height)}["loop","muted","playsinline"].forEach(function(e){if(c[e]!==undefined&&c[e]!=="false"||n[e]||n.embedState[e]||s[e]){s[e]=true}else{s[e]=false}});if(s.autoplay){s.playsinline=true}if(s.playsinline){i.setAttribute("playsinline","playsinline")}if(s.muted){i.setAttribute("muted","muted");i.muted=true}if(l){if(c.language){s.language=c.language}else if(W.isNonEmptyStr(Ny.documentElement.lang)){s.language=Ny.documentElement.lang}else{s.language=Ly.navigator.language}Ny.documentElement.lang=s.language}else if(i.hasAttribute("language")){s.language=i.getAttribute("language");t.log.warn("Use of the language attribute on the video embed is invalid. Please use the lang attribute instead.")}else if(!s.hasOwnProperty("language")&&W.isNonEmptyStr(n.language)){s.language=n.language}const v=i.getAttribute("data-bumper-id");const b=c.bumperId;const T=n.videoCloud?n.videoCloud.bumper:undefined;if(v||b||T){n.videoCloud=n.videoCloud||{};n.videoCloud.bumper=T&&typeof T==="object"?T:{};const A=v||b||T.id||T;if(typeof A==="string"){n.videoCloud.bumper.id=A}else{t.log.error("Bumper id must be a string")}}const{media:S}=n;if(S&&S.poster&&S.poster.highres&&!i.poster){if(/(https?:)?\/\//.test(S.poster.highres)){s.poster=S.poster.highres}else{s.poster=e.environment.scriptBaseUrl+"/"+S.poster.highres}if(t.browser.IS_IPHONE){i.poster=s.poster}}if(S&&S.tracks){S.tracks.forEach(function(e){i.appendChild(t.dom.createEl("track",{},{default:e.default?e.default:"",label:e.label?e.label:"",kind:"captions",src:e.src,srclang:e.srclang}))})}if(S&&S.src){s.sources=[S.src]}else if(S&&S.sources){s.sources=S.sources}s.runtime_=e;s.html5=s.html5||{};if(!(t.browser.IS_ANY_SAFARI||t.browser.IS_IOS)){s.html5.nativeCaptions=false}t.options.vhs=t.options.vhs||{};s.html5=s.html5||{};s.html5.vhs=s.html5.vhs||{};if(n.vhs&&typeof n.vhs==="object"){s.html5.vhs=n.vhs}if(t.browser.IS_ANDROID&&t.options.vhs.enableLowInitialPlaylist===undefined&&s.html5.vhs.enableLowInitialPlaylist===undefined){s.html5.vhs.enableLowInitialPlaylist=true}if(!(t.browser.IS_ANY_SAFARI||t.browser.IS_IOS)&&t.options.vhs.overrideNative===undefined&&s.html5.vhs.overrideNative===undefined){s.html5.vhs.overrideNative=true}if(t.options.vhs.experimentalLLHLS===undefined&&s.html5.vhs.experimentalLLHLS===undefined){s.html5.vhs.experimentalLLHLS=true}if(t.options.vhs.experimentalBufferBasedABR===undefined&&s.html5.vhs.experimentalBufferBasedABR===undefined){s.html5.vhs.experimentalBufferBasedABR=true}s.html5.initialBandwidth=typeof s.html5.initialBandwidth==="number"?s.html5.initialBandwidth:n.initialBandwidth;s.inactivityTimeout=5e3;s.controls=l?true:n.embedState.controls;s.persistTextTrackSettings=true;s.sourceOrder=true;s.userActions={hotkeys:{}};if(n.playerMode==="outstream"){if(n.controlBar){n.controlBar.fullscreenToggle=false}else{n.controlBar={fullscreenToggle:false}}n.fullscreenControl=false}if(n.fullscreenControl===false){s.userActions.doubleClick=false}const E=e.environment.userAgent.match(/applewebkit\/(\d*).*Version\/(\d*.\d*)/i);s.nativeControlsForTouch=t.browser.IS_ANDROID&&t.browser.ANDROID_VERSION<5&&E&&E[2]>0;const w=t.getPluginVersion("ima3");s.normalizeAutoplay=w?W.isValidVersion(w,4):true;["controlBar","liveui","playbackRates","responsive","suppressNotSupportedError","techOrder"].forEach(e=>{if(n.hasOwnProperty(e)){s[e]=n[e]}});return s}const Jt=v.getComponent("MenuItem");class Zt extends Jt{handleClick(e){super.handleClick();this.options_.listener();Ly.setTimeout(()=>{this.player().contextmenuUI.menu.dispose()},1)}}const ei=v.getComponent("Menu");const ti=v.dom||v;class ii extends ei{constructor(i,e){super(i,e);this.dispose=this.dispose.bind(this);e.content.forEach(e=>{let t=function(){};if(typeof e.listener==="function"){t=e.listener}else if(typeof e.href==="string"){t=()=>Ly.open(e.href)}this.addItem(new Zt(i,{label:e.label,listener:t.bind(i)}))})}createEl(){const e=super.createEl();ti.addClass(e,"vjs-contextmenu-ui-menu");e.style.left=this.options_.position.left+"px";e.style.top=this.options_.position.top+"px";return e}}function si(e){let t;if(e.getBoundingClientRect&&e.parentNode){t=e.getBoundingClientRect()}if(!t){return{left:0,top:0}}const i=Ny.documentElement;const s=Ny.body;const n=i.clientLeft||s.clientLeft||0;const r=Ly.pageXOffset||s.scrollLeft;const a=t.left+r-n;const o=i.clientTop||s.clientTop||0;const l=Ly.pageYOffset||s.scrollTop;const c=t.top+l-o;return{left:Math.round(a),top:Math.round(c)}}function ni(e,t){const i={};const s=si(e);const n=e.offsetWidth;const r=e.offsetHeight;const a=s.top;const o=s.left;let l=t.pageY;let c=t.pageX;if(t.changedTouches){c=t.changedTouches[0].pageX;l=t.changedTouches[0].pageY}i.y=Math.max(0,Math.min(1,(a-l+r)/r));i.x=Math.max(0,Math.min(1,(c-o)/n));return i}var ri="7.0.0";function ai(e){return e.hasOwnProperty("contextmenuUI")&&e.contextmenuUI.hasOwnProperty("menu")&&e.contextmenuUI.menu.el()}function oi(e){const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"}function li(e,t){return{left:Math.round(t.width*e.x),top:Math.round(t.height-t.height*e.y)}}function ci(e){if(ai(this)){this.contextmenuUI.menu.dispose();return}if(this.contextmenuUI.options_.excludeElements(e.target)){return}const t=ni(this.el(),e);const i=this.el().getBoundingClientRect();const s=li(t,i);const n=v.browser.IS_FIREFOX?Ny.documentElement:Ny;e.preventDefault();const r=this.contextmenuUI.menu=new ii(this,{content:this.contextmenuUI.content,position:s});this.contextmenuUI.closeMenu=()=>{v.log.warn("player.contextmenuUI.closeMenu() is deprecated, please use player.contextmenuUI.menu.dispose() instead!");r.dispose()};r.on("dispose",()=>{v.off(n,["click","tap"],r.dispose);this.removeChild(r);delete this.contextmenuUI.menu});this.addChild(r);const a=r.el_.getBoundingClientRect();const o=Ny.body.getBoundingClientRect();if(this.contextmenuUI.keepInside||a.right>o.width||a.bottom>o.height){r.el_.style.left=Math.floor(Math.min(s.left,this.player_.currentWidth()-r.currentWidth()))+"px";r.el_.style.top=Math.floor(Math.min(s.top,this.player_.currentHeight()-r.currentHeight()))+"px"}v.on(n,["click","tap"],r.dispose)}function ui(e){const t={keepInside:true,excludeElements:oi};e=v.obj.merge(t,e);if(!Array.isArray(e.content)){throw new Error('"content" required')}if(ai(this)){this.contextmenuUI.menu.dispose();this.off("contextmenu",this.contextmenuUI.onContextMenu);delete this.contextmenuUI}const i=this.contextmenuUI=function(){ui.apply(this,arguments)};i.onContextMenu=ci.bind(this);i.content=e.content;i.keepInside=e.keepInside;i.options_=e;i.VERSION=ri;this.on("contextmenu",i.onContextMenu);this.ready(()=>this.addClass("vjs-contextmenu-ui"))}v.registerPlugin("contextmenuUI",ui);ui.VERSION=ri;const di=function(e){e.registerPlugin("urlparams",function(r){r=r||{};var e=function(e){var t=0,i;e=(e||"").replace(/^\s+|\s+$/g,"");if(!e||!/^(\d+h)?(\d+m)?(\d+s)?$/.test(e)){return-1}i=e.match(/^(\d+)h/);if(i){t+=parseFloat(i[1])*3600;e=e.replace(/^(\d+)h/,"")}i=e.match(/^(\d+)m/);if(i){t+=parseFloat(i[1])*60;e=e.replace(/^(\d+)m/,"")}i=e.match(/^(\d+)s/);if(i){t+=parseFloat(i[1])}return t},s=.9,a=function(e,t){var i=e-t;if(isNaN(i)){return false}return Math.abs(i)<s},o=function(e){l.ready(function(){if(l.networkState()===2){e()}else{l.one("loadedmetadata",function(){l.setTimeout(e,0)})}})},l=this;W.qs();var c;if(typeof r.time==="number"){c=r.time}else{c=e(r.time)}if(c>0){(function(){var e=r.delay||250,t,i=false,s=function(){if(i||a(l.currentTime(),c)){i=true;n()}else{l.one("canplay",function(){l.currentTime(c)});t=l.setTimeout(s,e)}},n=function(){l.clearTimeout(t);l.off("timeupdate",n);if(!i){l.currentTime(c)}};l.on("timeupdate",n);o(s)})()}})};var hi=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var a=i.length;for(var o=0;o<a;++o){i[o].apply(this,r)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var fi=function e(t){return Ly.atob?Ly.atob(t):Py.from(t,"base64").toString("binary")};function pi(e){var t=fi(e);var i=new Uint8Array(t.length);for(var s=0;s<t.length;s++){i[s]=t.charCodeAt(s)}return i}class mi extends hi{constructor(){super();this.buffer=""}push(e){let t;this.buffer+=e;t=this.buffer.indexOf("\n");for(;t>-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const gi=String.fromCharCode(9);const yi=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const _i=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const f=function(e){const t={};if(!e){return t}const i=e.split(_i());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).slice(1);n[0]=n[0].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1");t[n[0]]=n[1]}return t};class vi extends hi{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(s){let l;let c;s=s.trim();if(s.length===0){return}if(s[0]!=="#"){this.trigger("data",{type:"uri",uri:s});return}const e=this.tagMappers.reduce((e,t)=>{const i=t(s);if(i===s){return e}return e.concat([i])},[s]);e.forEach(t=>{for(let e=0;e<this.customParsers.length;e++){if(this.customParsers[e].call(this,t)){return}}if(t.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:t.slice(1)});return}t=t.replace("\r","");l=/^#EXTM3U/.exec(t);if(l){this.trigger("data",{type:"tag",tagType:"m3u"});return}l=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t);if(l){c={type:"tag",tagType:"inf"};if(l[1]){c.duration=parseFloat(l[1])}if(l[2]){c.title=l[2]}this.trigger("data",c);return}l=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t);if(l){c={type:"tag",tagType:"targetduration"};if(l[1]){c.duration=parseInt(l[1],10)}this.trigger("data",c);return}l=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t);if(l){c={type:"tag",tagType:"version"};if(l[1]){c.version=parseInt(l[1],10)}this.trigger("data",c);return}l=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(l){c={type:"tag",tagType:"media-sequence"};if(l[1]){c.number=parseInt(l[1],10)}this.trigger("data",c);return}l=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(l){c={type:"tag",tagType:"discontinuity-sequence"};if(l[1]){c.number=parseInt(l[1],10)}this.trigger("data",c);return}l=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t);if(l){c={type:"tag",tagType:"playlist-type"};if(l[1]){c.playlistType=l[1]}this.trigger("data",c);return}l=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t);if(l){c=w(yi(l[1]),{type:"tag",tagType:"byterange"});this.trigger("data",c);return}l=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t);if(l){c={type:"tag",tagType:"allow-cache"};if(l[1]){c.allowed=!/NO/.test(l[1])}this.trigger("data",c);return}l=/^#EXT-X-MAP:(.*)$/.exec(t);if(l){c={type:"tag",tagType:"map"};if(l[1]){const e=f(l[1]);if(e.URI){c.uri=e.URI}if(e.BYTERANGE){c.byterange=yi(e.BYTERANGE)}}this.trigger("data",c);return}l=/^#EXT-X-STREAM-INF:(.*)$/.exec(t);if(l){c={type:"tag",tagType:"stream-inf"};if(l[1]){c.attributes=f(l[1]);if(c.attributes.RESOLUTION){const i=c.attributes.RESOLUTION.split("x");const s={};if(i[0]){s.width=parseInt(i[0],10)}if(i[1]){s.height=parseInt(i[1],10)}c.attributes.RESOLUTION=s}if(c.attributes.BANDWIDTH){c.attributes.BANDWIDTH=parseInt(c.attributes.BANDWIDTH,10)}if(c.attributes["FRAME-RATE"]){c.attributes["FRAME-RATE"]=parseFloat(c.attributes["FRAME-RATE"])}if(c.attributes["PROGRAM-ID"]){c.attributes["PROGRAM-ID"]=parseInt(c.attributes["PROGRAM-ID"],10)}}this.trigger("data",c);return}l=/^#EXT-X-MEDIA:(.*)$/.exec(t);if(l){c={type:"tag",tagType:"media"};if(l[1]){c.attributes=f(l[1])}this.trigger("data",c);return}l=/^#EXT-X-ENDLIST/.exec(t);if(l){this.trigger("data",{type:"tag",tagType:"endlist"});return}l=/^#EXT-X-DISCONTINUITY/.exec(t);if(l){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}l=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t);if(l){c={type:"tag",tagType:"program-date-time"};if(l[1]){c.dateTimeString=l[1];c.dateTimeObject=new Date(l[1])}this.trigger("data",c);return}l=/^#EXT-X-KEY:(.*)$/.exec(t);if(l){c={type:"tag",tagType:"key"};if(l[1]){c.attributes=f(l[1]);if(c.attributes.IV){if(c.attributes.IV.substring(0,2).toLowerCase()==="0x"){c.attributes.IV=c.attributes.IV.substring(2)}c.attributes.IV=c.attributes.IV.match(/.{8}/g);c.attributes.IV[0]=parseInt(c.attributes.IV[0],16);c.attributes.IV[1]=parseInt(c.attributes.IV[1],16);c.attributes.IV[2]=parseInt(c.attributes.IV[2],16);c.attributes.IV[3]=parseInt(c.attributes.IV[3],16);c.attributes.IV=new Uint32Array(c.attributes.IV)}}this.trigger("data",c);return}l=/^#EXT-X-START:(.*)$/.exec(t);if(l){c={type:"tag",tagType:"start"};if(l[1]){c.attributes=f(l[1]);c.attributes["TIME-OFFSET"]=parseFloat(c.attributes["TIME-OFFSET"]);c.attributes.PRECISE=/YES/.test(c.attributes.PRECISE)}this.trigger("data",c);return}l=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t);if(l){c={type:"tag",tagType:"cue-out-cont"};if(l[1]){c.data=l[1]}else{c.data=""}this.trigger("data",c);return}l=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t);if(l){c={type:"tag",tagType:"cue-out"};if(l[1]){c.data=l[1]}else{c.data=""}this.trigger("data",c);return}l=/^#EXT-X-CUE-IN:(.*)?$/.exec(t);if(l){c={type:"tag",tagType:"cue-in"};if(l[1]){c.data=l[1]}else{c.data=""}this.trigger("data",c);return}l=/^#EXT-X-SKIP:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"skip"};c.attributes=f(l[1]);if(c.attributes.hasOwnProperty("SKIPPED-SEGMENTS")){c.attributes["SKIPPED-SEGMENTS"]=parseInt(c.attributes["SKIPPED-SEGMENTS"],10)}if(c.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")){c.attributes["RECENTLY-REMOVED-DATERANGES"]=c.attributes["RECENTLY-REMOVED-DATERANGES"].split(gi)}this.trigger("data",c);return}l=/^#EXT-X-PART:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"part"};c.attributes=f(l[1]);["DURATION"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=parseFloat(c.attributes[e])}});["INDEPENDENT","GAP"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=/YES/.test(c.attributes[e])}});if(c.attributes.hasOwnProperty("BYTERANGE")){c.attributes.byterange=yi(c.attributes.BYTERANGE)}this.trigger("data",c);return}l=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"server-control"};c.attributes=f(l[1]);["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=parseFloat(c.attributes[e])}});["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=/YES/.test(c.attributes[e])}});this.trigger("data",c);return}l=/^#EXT-X-PART-INF:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"part-inf"};c.attributes=f(l[1]);["PART-TARGET"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=parseFloat(c.attributes[e])}});this.trigger("data",c);return}l=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"preload-hint"};c.attributes=f(l[1]);["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=parseInt(c.attributes[e],10);const t=e==="BYTERANGE-LENGTH"?"length":"offset";c.attributes.byterange=c.attributes.byterange||{};c.attributes.byterange[t]=c.attributes[e];delete c.attributes[e]}});this.trigger("data",c);return}l=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"rendition-report"};c.attributes=f(l[1]);["LAST-MSN","LAST-PART"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=parseInt(c.attributes[e],10)}});this.trigger("data",c);return}l=/^#EXT-X-DATERANGE:(.*)$/.exec(t);if(l&&l[1]){c={type:"tag",tagType:"daterange"};c.attributes=f(l[1]);["ID","CLASS"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=String(c.attributes[e])}});["START-DATE","END-DATE"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=new Date(c.attributes[e])}});["DURATION","PLANNED-DURATION"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=parseFloat(c.attributes[e])}});["END-ON-NEXT"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=/YES/i.test(c.attributes[e])}});["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){if(c.attributes.hasOwnProperty(e)){c.attributes[e]=c.attributes[e].toString(16)}});const n=/^X-([A-Z]+-)+[A-Z]+$/;for(const r in c.attributes){if(!n.test(r)){continue}const a=/[0-9A-Fa-f]{6}/g.test(c.attributes[r]);const o=/^\d+(\.\d+)?$/.test(c.attributes[r]);c.attributes[r]=a?c.attributes[r].toString(16):o?parseFloat(c.attributes[r]):String(c.attributes[r])}this.trigger("data",c);return}l=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(t);if(l){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}this.trigger("data",{type:"tag",data:t.slice(4)})})}addParser({expression:i,customType:s,dataParser:n,segment:r}){if(typeof n!=="function"){n=e=>e}this.customParsers.push(e=>{const t=i.exec(e);if(t){this.trigger("data",{type:"custom",data:n(e),customType:s,segment:r});return true}})}addTagMapper({expression:t,map:i}){const e=e=>{if(t.test(e)){return i(e)}return e};this.tagMappers.push(e)}}const bi=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const Ti=function(t){const i={};Object.keys(t).forEach(function(e){i[bi(e)]=t[e]});return i};const Si=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=s&&s*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]<o){this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`});t[r]=o}if(s&&!t.hasOwnProperty(a)){t[a]=s*3;this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})}if(s&&t[a]<l){this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`});t[a]=l}};class Ei extends hi{constructor(){super();this.lineStream=new mi;this.parseStream=new vi;this.lineStream.pipe(this.parseStream);const e=this;const s=[];let r={};let n;let o;let l=false;const c=function(){};const u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};const d="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:true,discontinuityStarts:[],segments:[]};let f=0;let p=0;const m={};this.on("end",()=>{if(r.uri||!r.parts&&!r.preloadHints){return}if(!r.map&&n){r.map=n}if(!r.key&&o){r.key=o}if(!r.timeline&&typeof h==="number"){r.timeline=h}this.manifest.preloadSegment=r});this.parseStream.on("data",function(a){let t;let i;({tag(){({version(){if(a.version){this.manifest.version=a.version}},"allow-cache"(){this.manifest.allowCache=a.allowed;if(!("allowed"in a)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in a){r.byterange=e;e.length=a.length;if(!("offset"in a)){a.offset=f}}if("offset"in a){r.byterange=e;e.offset=a.offset}f=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(a.duration>0){r.duration=a.duration}if(a.duration===0){r.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=s},key(){if(!a.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(a.attributes.METHOD==="NONE"){o=null;return}if(!a.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(a.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:a.attributes};return}if(a.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:a.attributes.URI};return}if(a.attributes.KEYFORMAT===d){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(a.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(a.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(a.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(a.attributes.KEYID&&a.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:a.attributes.KEYFORMAT,keyId:a.attributes.KEYID.substring(2)},pssh:pi(a.attributes.URI.split(",")[1])};return}if(!a.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}o={method:a.attributes.METHOD||"AES-128",uri:a.attributes.URI};if(typeof a.attributes.IV!=="undefined"){o.iv=a.attributes.IV}},"media-sequence"(){if(!isFinite(a.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+a.number});return}this.manifest.mediaSequence=a.number},"discontinuity-sequence"(){if(!isFinite(a.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+a.number});return}this.manifest.discontinuitySequence=a.number;h=a.number},"playlist-type"(){if(!/VOD|EVENT/.test(a.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+a.playlist});return}this.manifest.playlistType=a.playlistType},map(){n={};if(a.uri){n.uri=a.uri}if(a.byterange){n.byterange=a.byterange}if(o){n.key=o}},"stream-inf"(){this.manifest.playlists=s;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!a.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!r.attributes){r.attributes={}}w(r.attributes,a.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(a.attributes&&a.attributes.TYPE&&a.attributes["GROUP-ID"]&&a.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[a.attributes.TYPE];e[a.attributes["GROUP-ID"]]=e[a.attributes["GROUP-ID"]]||{};t=e[a.attributes["GROUP-ID"]];i={default:/yes/i.test(a.attributes.DEFAULT)};if(i.default){i.autoselect=true}else{i.autoselect=/yes/i.test(a.attributes.AUTOSELECT)}if(a.attributes.LANGUAGE){i.language=a.attributes.LANGUAGE}if(a.attributes.URI){i.uri=a.attributes.URI}if(a.attributes["INSTREAM-ID"]){i.instreamId=a.attributes["INSTREAM-ID"]}if(a.attributes.CHARACTERISTICS){i.characteristics=a.attributes.CHARACTERISTICS}if(a.attributes.FORCED){i.forced=/yes/i.test(a.attributes.FORCED)}t[a.attributes.NAME]=i},discontinuity(){h+=1;r.discontinuity=true;this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=a.dateTimeString;this.manifest.dateTimeObject=a.dateTimeObject}r.dateTimeString=a.dateTimeString;r.dateTimeObject=a.dateTimeObject},targetduration(){if(!isFinite(a.duration)||a.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+a.duration});return}this.manifest.targetDuration=a.duration;Si.call(this,this.manifest)},start(){if(!a.attributes||isNaN(a.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:a.attributes["TIME-OFFSET"],precise:a.attributes.PRECISE}},"cue-out"(){r.cueOut=a.data},"cue-out-cont"(){r.cueOutCont=a.data},"cue-in"(){r.cueIn=a.data},skip(){this.manifest.skip=Ti(a.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",a.attributes,["SKIPPED-SEGMENTS"])},part(){l=true;const e=this.manifest.segments.length;const t=Ti(a.attributes);r.parts=r.parts||[];r.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=p}p=t.byterange.offset+t.byterange.length}const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,a.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=Ti(a.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}Si.call(this,this.manifest);if(e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")){this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})}},"preload-hint"(){const t=this.manifest.segments.length;const i=Ti(a.attributes);const e=i.type&&i.type==="PART";r.preloadHints=r.preloadHints||[];r.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=e?p:0;if(e){p=i.byterange.offset+i.byterange.length}}}const s=r.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,a.attributes,["TYPE","URI"]);if(!i.type){return}for(let e=0;e<r.preloadHints.length-1;e++){const n=r.preloadHints[e];if(!n.type){continue}if(n.type===i.type){this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`})}}},"rendition-report"(){const e=Ti(a.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1;const i=["LAST-MSN","URI"];if(l){i.push("LAST-PART")}this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,a.attributes,i)},"part-inf"(){this.manifest.partInf=Ti(a.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",a.attributes,["PART-TARGET"]);if(this.manifest.partInf.partTarget){this.manifest.partTargetDuration=this.manifest.partInf.partTarget}Si.call(this,this.manifest)},daterange(){this.manifest.daterange=this.manifest.daterange||[];this.manifest.daterange.push(Ti(a.attributes));const e=this.manifest.daterange.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,a.attributes,["ID","START-DATE"]);const t=this.manifest.daterange[e];if(t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)){this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"})}if(t.duration&&t.duration<0){this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"})}if(t.plannedDuration&&t.plannedDuration<0){this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"})}const i=!!t.endOnNext;if(i&&!t.class){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"})}if(i&&(t.duration||t.endDate)){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"})}if(t.duration&&t.endDate){const s=t.startDate;const n=s.setSeconds(s.getSeconds()+t.duration);this.manifest.daterange[e].endDate=new Date(n)}if(t&&!this.manifest.dateTimeString){this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"})}if(!m[t.id]){m[t.id]=t}else{for(const r in m[t.id]){if(m[t.id][r]!==t[r]){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes and same attribute values"});break}}}},"independent-segments"(){this.manifest.independentSegments=true}}[a.tagType]||c).call(e)},uri(){r.uri=a.uri;s.push(r);if(this.manifest.targetDuration&&!("duration"in r)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});r.duration=this.manifest.targetDuration}if(o){r.key=o}r.timeline=h;if(n){r.map=n}p=0;r={}},comment(){},custom(){if(a.segment){r.custom=r.custom||{};r.custom[a.customType]=a.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[a.customType]=a.data}}})[a.type].call(e)})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(e){if(!t.hasOwnProperty(e)){s.push(e)}});if(s.length){this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n");this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var wi=(t,e,i={})=>{e.forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});return i};const Ii=r=>{const a=(i,s=[])=>{let n={};Object.keys(i).forEach(e=>{const t=i[e];s.push(e);if(ht(t)){n=r.obj.merge(n,a(t,s))}else{n[s.join(".")]=t}s.pop()});return n};return a};const Ci=e=>e.charAt(0).toUpperCase()+e.slice(1);const ki=(e,t)=>`${e}x${t}`;const Ai={memory:["jsHeapSizeLimit","usedJSHeapSize","totalJSHeapSize"],navigation:["redirectCount","type","directedMigration"],timing:["loadEventEnd","loadEventStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","responseEnd","responseStart","requestStart","secureConnectionStart","connectEnd","connectStart","domainLookupEnd","domainLookupStart","fetchStart","redirectEnd","redirectStart","unloadEventEnd","unloadEventStart","navigationStart"]};const Di={bitrate:"bitrates",event:"events"};const xi=n=>{const t=Ii(n);class e{constructor(){this.data_={bitrates:{bitrates:[],playlists:[],rendered:[],throughput:[]},events:[],mr:0,locked:0,performance:{},content:{},player:{dimensions:[],pixelratio:[],screendimensions:[]},frames:{}}}keys(){return Object.keys(this.data_)}append(e,...t){e=Di.hasOwnProperty(e)?Di[e]:e;if(!this.data_.hasOwnProperty(e)){throw new Error(`"${e}" is not a known QosBuffer key`)}this[`append${Ci(e)}_`](...t)}flush(...t){if(!t.length){t=this.keys()}for(let e=0;e<t.length;e++){if(!this.data_.hasOwnProperty(t[e])){throw new Error(`"${t[e]}" is not a known QosBuffer key`)}}const e=t.map(e=>this[`flush${Ci(e)}_`]());const i=n.obj.merge(...e);const s=ct().stringify(i).length;if(s>3e3&&i["qos.bitrates"]){i["qos.bitrates"]=JSON.stringify({bitrates:[],playlists:[],rendered:[],throughput:[]})}return i}appendBitrates_(t){if(typeof t.playlists!=="undefined"){this.data_.bitrates.playlists.push([Date.now(),t.bitrates,t.playlists]);delete t.bitrates;delete t.playlists}Object.keys(t).forEach(e=>{this.data_.bitrates[e].push([Date.now(),t[e]])})}appendMr_(e){this.data_.mr=e?1:null}appendLocked_(e){this.data_.locked=e?1:null}appendPerformance_(e){const i=Ly.performance;if(k(i)){return}Object.keys(Ai).forEach(e=>{if(!k(i[e])){this.data_.performance[e]=wi(i[e],Ai[e])}});if(x(i.measure)){["bcParse","bcInit"].forEach(t=>{i.getEntriesByName(t,"measure").forEach(e=>{this.data_.performance[t]=e.duration})})}if(this.data_.performance.navigation){this.data_.performance.navigation.directedMigration=e?ct().parse(e).directedMigration==="true":false}}appendFrames_(e){this.data_.frames={dropped:e.droppedVideoFrames,corrupted:e.corruptedVideoFrames,total:e.totalVideoFrames}}appendPlayer_(e,t=Date.now()){this.data_.player.dimensions.push([t,ki(e.width,e.height),ki(e.computedWidth,e.computedHeight)]);this.data_.player.pixelratio.push([t,Ly.devicePixelRatio]);this.data_.player.screendimensions.push([t,ki(Ly.screen.width,Ly.screen.height)])}appendEvents_(...e){this.data_.events.push({type:e.join("."),time:Date.now()})}appendContent_(e){this.data_.content={sourceMimeType:e.sourceMimeType}}flushBitrates_(){const e=this.data_.bitrates;const t={};if(e.bitrates.length||e.playlists.length||e.rendered.length||e.throughput.length){t["qos.bitrates"]=JSON.stringify(e)}e.bitrates.length=0;e.playlists.length=0;e.rendered.length=0;e.throughput.length=0;return t}flushEvents_(){const e=this.data_.events;const n={};e.forEach(e=>{const{time:t,type:i}=e;const s=`qos.events.${i}`;if(Array.isArray(n[s])){n[s].push(t)}else if(n.hasOwnProperty(s)){n[s]=[n[s],t]}else{n[s]=t}});Object.keys(n).forEach(e=>{if(Array.isArray(n[e])){n[e]=JSON.stringify(n[e])}});e.length=0;return n}flushMr_(){return{"qos.mr":this.data_.mr}}flushLocked_(){return{"qos.locked":this.data_.locked}}flushFrames_(){const e=t(this.data_.frames,["qos","frames"]);this.data_.frames={};return e}flushPerformance_(){return t(this.data_.performance,["qos","performance"])}flushPlayer_(){const i=this.data_.player;const s={};Object.keys(i).forEach(e=>{const t=i[e];if(t.length){s[`qos.player.${e}`]=JSON.stringify(t);t.length=0}});return s}flushContent_(){return t(this.data_.content,["qos","content"])}}return e};const Oi=["ad-playback","ads-ready?","postroll?","preroll?"];const Pi=e=>e.usingPlugin("ads")?e.ads.state:undefined;const Ri=e=>e.usingPlugin("ads")&&!!e.adonly;const Li=e=>Oi.indexOf(e)>-1;const Ni=e=>e.usingPlugin("ads")&&x(e.ads.inAdBreak);const P=e=>{if(!e.usingPlugin("ads")){return false}if(Ri(e)){return true}if(Ni(e)){return e.ads.isInAdMode()}return Li(e.ads.state)};const Mi=e=>{if(!e.usingPlugin("ads")){return false}return e.ads.isContentResuming()&&!e.ads.isWaitingForAdBreak()};const Ui=(e,t)=>{if(Ni(t)&&e&&e.type==="loadstart"){return true}return!P(t)};const Bi=e=>{const t={};if(e.ima3){const i=e.ima3.currentAdEventInfo;t.plugin="ima3";if(x(e.ima3)){return t}t.pluginVersion=e.ima3.VERSION||e.ima3.version;t.adTech=e.ima3.adTech;t.requestMode=e.ima3.settings.requestMode;t.timeout=e.ima3.settings.timeout;if(i){wi(i,["adType","adPodLength","adPodId","creativeFormat","creativeLength","creativeId","creativeIndex","advertiserName","wrapperCreativeIds","dealId","adId","adTitle","adSystem","creativeAdId"],t);const s=i.creativeIndex;if(s&&s.length){t.firstPlayedAdIndex=s[0]}t.startedInAdPod=i.started;t.completedInAdPod=i.completed}}else if(e.FreeWheelPlugin){t.plugin="freewheel";if(x(e.FreeWheelPlugin)){return t}t.pluginVersion=e.FreeWheelPlugin.VERSION||e.FreeWheelPlugin.getVersion()}return t};const Fi=e=>{e.adBreakIndex=null;e.hasAdBreakStarted=false;e["ads-request"]=null;e["ads-response-received"]=null;e["ads-loading"]=[];e["ads-ad-started"]=[];e["ads-ad-ended"]=[]};const qi=()=>{const e={};Fi(e);return e};const ji=(e,t,i)=>{const s=e.currentAdSequence_;const n=["ads-loading","ads-ad-started","ads-ad-ended"];if(t==="ads-request"){Fi(s)}else if(t==="adstart"||t==="ads-loading"){if(!s.hasAdBreakStarted){if(s.adBreakIndex===null){s.adBreakIndex=0}else{s.adBreakIndex++}s.hasAdBreakStarted=true;n.forEach(e=>{s[e].push([])})}}else if(t==="adend"){s.hasAdBreakStarted=false}if(n.indexOf(t)>-1){s[t][s.adBreakIndex].push(i)}else if(t==="ads-request"||t==="ads-response-received"){s[t]=i}};const e={NUMBER_GTE_0:{validator:e=>typeof e==="number"&&e>=0,message:"must be a number equal or greater than 0"},NON_EMPTY_STRING:{validator:O,message:"must be a non-empty string"},NUMERIC_BOOL:{validator:e=>e===0||e===1,message:"must be 0 or 1"}};const Vi=[{name:"index",validation:e.NUMBER_GTE_0},{name:"deal_id",validation:e.NON_EMPTY_STRING},{name:"wrapper_systems",validation:e.NON_EMPTY_STRING},{name:"system",validation:e.NON_EMPTY_STRING},{name:"skip_time_offset",validation:e.NUMBER_GTE_0},{name:"start_ms",validation:e.NUMBER_GTE_0},{name:"advertiser",validation:e.NON_EMPTY_STRING},{name:"content_type",validation:e.NON_EMPTY_STRING},{name:"isci",validation:e.NON_EMPTY_STRING},{name:"creative_id",validation:e.NON_EMPTY_STRING},{name:"duration",validation:e.NUMBER_GTE_0},{name:"title",validation:e.NON_EMPTY_STRING},{name:"media_url_domain",validation:e.NON_EMPTY_STRING},{name:"audible_duration",validation:e.NUMBER_GTE_0},{name:"play_duration",validation:e.NUMBER_GTE_0},{name:"skipped",validation:e.NUMERIC_BOOL},{name:"interaction",validation:e.NUMERIC_BOOL}];const $i=[{name:"index",validation:{validator:e=>typeof e==="undefined"||typeof e==="number"&&(e>=0||e===-1),message:"must be a number equal or greater than 0 or exactly -1 or undefined"}},{name:"ad_count",validation:e.NUMBER_GTE_0},{name:"duration",validation:e.NUMBER_GTE_0},{name:"host",validation:e.NON_EMPTY_STRING},{name:"type",validation:{validator:e=>e==="pre"||e==="mid"||e==="post",message:'must be one of "pre"|"mid"|"post"'}},{name:"request_mode",validation:{validator:e=>e==="onload"||e==="onplay"||e==="ondemand"||e==="oncue",message:'must be one of "onload"|"onplay"|"ondemand"|"oncue"'}},{name:"time_offset",validation:e.NUMBER_GTE_0},{name:"request_ms",validation:e.NUMBER_GTE_0}];const Hi=Bt(Vi,"ads_ad_");const Gi=Bt($i,"ads_pod_");const zi=["progress","seeking","suspend","timeupdate"];const Wi=["seek","stable","unstable"];const Yi=["adend","adscanceled","adserror","adskip","adsready","adstart","adtimeout","contentplayback","contentupdate","nopostroll","nopreroll","readyforpreroll"];const Xi=e=>{return[].concat(e.getTech("Html5").Events)};const Ki=e=>{return Xi(e).filter(e=>zi.indexOf(e)===-1)};const Qi=["ads-request","ads-response-received","adstart","ads-loading","ads-ad-started","ads-ad-ended","adend"];const Ji=["ad_begin","ad_complete","ad_error","ad_hard_timeout","ad_mode_begin","ad_mode_complete","ad_timeout","ad_viewable_impression","catalog_request","catalog_request_error","catalog_response","error","play_request","player_init","player_load","video_complete","video_engagement","video_impression","video_resumed","video_view"];const Zi=["catalog_request","catalog_request_error","catalog_response"];const es=e=>{const t=e.options_.runtime_;const i=t&&t.settings;const s=i&&i.playerMode==="outstream";return s};const ts=e=>{if(e.includes("video_")){return false}return true};const is="sendBeacon"in Ly.navigator;const{Set:ss}=Ly;const ns="lbu";const rs=4e3;const as=new ss(["account","domain","event","player"]);const os=new ss(["account","delivery_type","destination","domain","dropped_frames","error_code","event","feature","file_size_bytes","forward_buffer_seconds","load_time_ms","measured_bps","media_type","platform","platform_version","player","player_height","player_name","player_width","range","rebuffering_count","rebuffering_seconds","rendition_height","rendition_indicated_bps","rendition_mime_type","rendition_width","response_time_ms","session","start_time_ms","source","time","video","video_duration","video_name","video_seconds_viewed"]);const ls=(e,t)=>{const i=ct();Object.keys(t).forEach(e=>{if(k(t[e])){delete t[e]}});let s=e+"?"+i.stringify(t);if(s.length<=rs){return s}Object.keys(t).forEach(e=>{if(!os.has(e)){delete t[e]}});t.usage=ns;s=e+"?"+i.stringify(t);return s};const cs=t=>{as.forEach(e=>{if(k(t[e])){throw new Error(`the "${e}" param is required`)}})};const us=a=>{const c=xi(a);class e{constructor(e,t,i,s,n={}){this.baseUrl_=i;this.log=s.createLogger("Client");this.stateAgent_=t;this.player_=e;this.currentAdSequence_=qi();this.beacons_=[];this.beaconsUnsent_=[];this.playerId=n.playerId;this.embedId=n.embedId;this.applicationId=n.applicationId;this.playerUrl_=null;this.user(n.user||null);this.device(n.device||null);const r=e.options_&&e.options_.runtime_||{};const a=r.environment&&r.environment.queryString||{};const o=r.settings;const l=o&&o.playerMode==="outstream"?o.playerMode:"media";if(n.requiresConsent){if(typeof Ly.BC_ANALYTICS_CONSENT==="boolean"){this.setConsent(Ly.BC_ANALYTICS_CONSENT,{silent:true});this.disableSetConsent()}else if(a.hasOwnProperty("analyticsConsent")||e.el().hasAttribute("data-analytics-consent")){this.setConsent(true,{silent:true});this.disableSetConsent()}else{this.setConsent(false,{silent:true})}}else{this.setConsent(true,{silent:true});this.disableSetConsent()}if(n.corpCommsApp){this.log.warn("The `corpCommsApp` option is deprecated. Please use `application` instead.")}this.application(n.application||n.corpCommsApp||null);this.defaultParams_={domain:"videocloud",platform:n.platform,session:"",player_mode:l};for(let e=0;e<3;e++){this.defaultParams_.session+=(Math.random()*4294967295>>>0).toString(16)}this.qos=new c(this);this.stateAgent_.resetTimesOf();this.subscribeToAnalyticsEvents_(e)}beacons(){return this.beacons_.map(a.obj.merge)}defaultParams(e){if(e){if(e.player){this.playerUrl_=e.player}if(e.player_mode&&e.player_mode!==this.defaultParams_.player_mode){this.log.warn("player_mode cannot be overriden");return}e=x(e)?e():e;this.defaultParams_=a.obj.merge(this.defaultParams_,e)}return this.defaultParams_}getSession(){return this.defaultParams_.session}user(e){if(e!==undefined){if(e===null||O(e)||dt(e)){this.user_=e}else{this.log.warn("user() must be given a non-empty string, number, or null")}if(this.player_.usingPlugin("chinaMetrics")){this.log.warn("user() cannot be set when using China Delivery");this.user_=null}}return this.user_}setUser(e){this.log.warn("setUser(id) is deprecated, use user(id) instead");this.user(e)}getUser(){this.log.warn("getUser() is deprecated, use user() instead");return this.user()}setConsent(e,t={}){if(typeof e==="boolean"&&this.consent_!==e){this.consent_=e;if(!t.silent){this.player_.trigger({consent:e,type:"analytics-consent-changed"})}}}disableSetConsent(){Object.defineProperty(this,"setConsent",{value:()=>{},configurable:false,enumerable:true,writable:false})}getConsent(){return this.consent_}application(e){if(e===null||O(e)||dt(e)){this.application_=e}return this.application_}corpCommsApp(e){if(e===null||O(e)||dt(e)){this.application_=e;this.log.warn("The corpCommsApp() method is deprecated. Please use application() instead.")}return this.application_}device(e){if(e===null||O(e)||dt(e)){this.device_=e}return this.device_}player(e){if(e===null||O(e)){this.defaultParams_.player=e;this.playerUrl_=e}return this.playerUrl_||this.defaultParams_.player}subscribeToAnalyticsEvents_(){this.player_.on("analytics-beacon",({params:e})=>{this.send(e)})}send(e={}){const{event:t}=e;if(!Ji.includes(t)||es(this.player_)&&!ts(t)){return null}const i=this.stateAgent_.getOptions(t);const s=this.sendRequest_(e,i);const n={video_view:"timeOfView",video_impression:"timeOfImpression"};if(s&&n.hasOwnProperty(t)){this.stateAgent_.state[n[t]]=Number(s.params.time)}return s}sendRequest_(e,t={}){if(this.getConsent()){const i=e.analyticsBcovAuthToken;delete e.analyticsBcovAuthToken;const s=ls(this.baseUrl_,e);if(Ji.indexOf(e.event)>-1){if(t.useSendBeaconOnly){if(is){Ly.navigator.sendBeacon(s)}else{return null}}else if(!!i&&e.event==="video_view"){const n={};n.Authorization="Bearer "+i;a.xhr({method:"GET",headers:n,url:s},function(e,t,i){if(e){a.log.debug("Problem sending video_view beacon",e)}})}else{const r=Ny.createElement("img");r.src=s}}return{params:e,url:s}}this.beaconsUnsent_.push({params:e,options:t});return null}sendAllUnsent(){const e=this.beaconsUnsent_.slice();this.beaconsUnsent_=[];return e.map(({params:e,options:t})=>{return this.sendRequest_(e,t)})}}return e};const ds=(e,t)=>Math.floor(e)+".."+(Math.floor(t)-1);const hs=(e,t,i,s)=>{let n=`players.brightcove.com/${e}/${t}_${i}`;if(s){n+=`/${s}`}return n};const fs=e=>{let t=e.preload();if(typeof t!=="string"){t=e.el().getAttribute("preload")}if(typeof t==="string"&&t.length===0){t="auto"}if(t){return t}};const ps=(e,t,i,s,n)=>{let r=t-e;if(n!==undefined&&n<t){r-=n-e}else if(i!==undefined&&s!==undefined){if(i<e){i=e}if(s>t){s=t}r-=s-i}return r};const ms=(e,t,...i)=>{const s=e.obj.merge(t.params||{},...i);delete t.params;return s};const gs=(e,t)=>{const i=e.mediainfo;const s=i&&i.duration||e.duration();if(i){if(t.video===undefined){t.video=i.id}if(t.video_name===undefined){t.video_name=i.name}if(t.reference_id===undefined){t.reference_id=i.referenceId}if(t.custom_fields===undefined){t.custom_fields=i.customFields}if(t.video_data===undefined){t.video_data=i}if(t.video_ads_supported===undefined){t.video_ads_supported=i.economics==="AD_SUPPORTED"}if(t.tags===undefined){t.tags=i.tags}}if(dt(s)&&t.video_duration===undefined){t.video_duration=Math.floor(s);if(t.video_duration<1||t.video_duration===Infinity){t.video_duration=null}}t.media_url=e.currentSrc();return t};const ys=["ads_ad_index","ads_ad_deal_id","ads_ad_wrapper_systems","ads_ad_system","ads_ad_skip_time_offset","ads_ad_start_ms","ads_ad_advertiser","ads_ad_content_type","ads_ad_isci","ads_ad_creative_id","ads_ad_duration","ads_ad_title","ads_ad_media_url_domain","ads_pod_index"];const _s=["ads_ad_audible_duration","ads_ad_play_duration","ads_ad_skipped","ads_ad_interaction"];const vs=["ads_pod_ad_count","ads_pod_duration","ads_pod_host","ads_pod_type","ads_pod_request_ms","ads_pod_request_mode","ads_pod_time_offset"];const bs=["ad_mode_begin","ad_mode_complete"];const Ts=(e,t={})=>{const i={};for(const s of e){if(t[s]!==undefined){i[s]=t[s]}}return i};const Ss={triggerAdBegin:{event:"ad_begin",params:ys},triggerAdComplete:{event:"ad_complete",params:[...ys,..._s]},triggerAdModeBegin:{event:"ad_mode_begin",params:[...ys,...vs]},triggerAdModeComplete:{event:"ad_mode_complete",params:[...ys,...vs]},triggerVideoResumed:{event:"video_resumed"},triggerAdViewableImpression:{event:"ad_viewable_impression",params:ys}};function Es(e){return{adBegin:()=>{e.triggerAdBegin()},adComplete:()=>{e.triggerAdComplete()},adModeBegin:()=>{e.triggerAdModeBegin()},adModeComplete:()=>{e.triggerAdModeComplete()},videoResumed:()=>{e.triggerVideoResumed()},adViewableImpression:()=>{e.triggerAdViewableImpression()}}}const ws=o=>{class e{constructor(e,t,i,s,n){this.player_=e;this.client_=t;this.history_=i;this.stateAgent_=s;this.log=n.createLogger("Emitter");this.eventCount_=0;this.streamCount_=-1;this.addInsightsTriggers()}addInsightsTriggers(){Object.keys(Ss).forEach(e=>{const t=Ss[e].event;const i=Ss[e].params;const s=Object.getPrototypeOf(this);s[e]=this.createInsightsTrigger(t,i)})}createInsightsTrigger(r,a){return(e={})=>{let t={event:r};if(a&&this.player_.ads&&this.player_.ads.ad){const{ad:i,pod:s}=this.player_.ads;const{merge:e}=o.obj;const n=bs.includes(r)&&s?e(i,s):i;t=e(t,Ts(a,n))}this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,t))}}emitAnalyticsEvents_(e,t){e.trigger({params:t,type:"analytics-beacon"});const i=String(t.event).replace(/\_/g,"-");e.trigger({params:t,type:`analytics-beacon-${i}`})}refineClientParams_(t,e){if(this.client_.user()){t.user=this.client_.user()}if(this.client_.application()){t.application=this.client_.application();t.user=this.client_.user()||this.client_.device()}if(k(t.time)){t.time=Date.now()}t.autoplay=this.player_.autoplay();e.qos=Array.isArray(e.qos)?e.qos:[];e.qos.push("mr");e.qos.push("locked");t=o.obj.merge(this.client_.defaultParams_,t,this.client_.qos.flush(...e.qos));t.seq=""+this.eventCount_;if(Ji.indexOf(t.event)>-1){this.eventCount_++}if("streamCount"in e){t.seq+="_"+e.streamCount}if(typeof this.player_.getAccountId==="function"){const i=this.player_.getAccountId();const s=t.account;let e="";if(O(i)){e=i}else if(O(s)){e=s}t.account=e;t.player=this.client_.playerUrl_||hs(t.account,this.client_.playerId,this.client_.embedId,this.client_.applicationId)}if(t.event&&t.event.startsWith("ad_")){if(this.player_.ads&&this.player_.ads.pod){const n=this.player_.ads.pod.index;if(n!==undefined){t.ads_pod_index=n}}}cs(t);return{params:t,options:e}}resolveData_(e,t){const i=["player_init","player_load",...Zi];const{params:s,options:n}=this.refineClientParams_(i.includes(t.event)?ms(o,e,t):gs(this.player_,ms(o,e,t)),e);if(Zi.includes(t.event)){const{error:r,xhr:a}=n;if(r){s.error=JSON.stringify(a?w(r,{status:a.status}):r)}}if(es(this.player_)){Object.keys(s).forEach(e=>{if(e.startsWith("video_")){delete s[e]}})}this.client_.beacons_.push(s);this.log.debug(s.event,s);this.stateAgent_.setOptions(s.event,n);return s}triggerAdError(e={},t){const i=t||this.player_.ads&&this.player_.ads.ad;const s=o.obj.merge({event:"ad_error"},Ts(ys,i));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,s))}triggerFullscreenEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_enabled"}))}triggerFullscreenDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_disabled"}))}triggerShareOverlay(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_overlay"}))}triggerShareSocialClicked(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_social_clicked"}))}triggerShareLinkCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_link_copied"}))}triggerShareEmbedCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_embed_copied"}))}triggerEnterPIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_enabled"}))}triggerLeavePIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_disabled"}))}triggerPin(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pin"}))}triggerUnpin(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"unpin"}))}triggerMuteEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_enabled"}))}triggerMuteDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_disabled"}))}triggerVolumeChange(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"volume_change"}))}triggerVideoPause(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_pause"}))}triggerVideoResume(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_resume"}))}triggerTextTrackEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_enabled"}))}triggerTextTrackDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_disabled"}))}triggerVideoImpression(e={}){const t=O(this.player_.currentSrc());if(!t||this.stateAgent_.state.timeOfImpression){this.log.debug("skipped video_impression",{reason:!t&&"there is no source"||`already sent at ${this.stateAgent_.state.timeOfImpression}`});return}this.streamCount_++;e.streamCount=this.streamCount_;const i=this.player_.currentType();if(O(i)){this.client_.qos.append("content",{sourceMimeType:i});e.qos=e.qos||["content"];const a=this.player_.audioOnlyMode_||this.player_.audioPosterMode_||this.player_.isAudio_;this.client_.defaultParams({media_type:bt(i,a)})}const s=this.resolveData_(e,{event:"video_impression"});const n=Bi(this.player_);const r=fs(this.player_);if(Object.keys(n).length>0){s.web_ad_info=JSON.stringify(n)}if(r){s.preload=r}this.emitAnalyticsEvents_(this.player_,s)}triggerVideoView(e={}){const t=O(this.player_.currentSrc());const{timeOfView:i,timeOfImpression:s}=this.stateAgent_.state;if(!t||i||!s){this.log.debug("skipped video_view",{reason:!t&&"there is no source"||i&&`already sent at ${i}`||'"video_impression" not sent'});return}e.streamCount=this.streamCount_;const n=this.resolveData_(e,{event:"video_view"});const r=this.history_;const a=r.first("canplay");const o=r.first("loadstart");const l=r.first("play",true);if(a){n.load_time_ms=a-s}n.start_time_ms=ps(l||o,n.time,r.first("adstart",true),r.first("adend",true),r.first("adtimeout",true));if(this.player_.usingPlugin("pluginDev")){n.feature="iris"}this.emitAnalyticsEvents_(this.player_,n)}triggerVideoEngagement(t,e,i={}){const{buffered:s,duration:n,playbackEndTime:r,height:a,mediainfo:o,rebufferingCount:l,rendition:c,renditionWidth:u,renditionHeight:d,playbackStartTime:h,rangeStart:f,rangeEnd:p,rebuffering:m,rebufferingTime:g,rebufferingStart:y,stats:_,width:v}=e;const b=r-h;i.qos=i.qos||["bitrates","events","player","frames"];i.streamCount=this.streamCount_;t.length=t.end-t.start;this.log.debug("video_engagement requested",{rawOptions:i,period:t,playbackStartTime:h,playbackLength:b,playbackEndTime:r});let T=g;if(m&&y>0){const w=(Date.now()-y)/1e3;T=parseFloat(g+w).toFixed(1)}if(b<1&&T<=0){this.log.debug("video_engagement skipped; no rebuffering detected and playback duration too short");return null}const S=this.resolveData_(i,{event:"video_engagement"});S.player_height=a;S.player_width=v;S.video_duration=n;S.rendition_width=u;S.rendition_height=d;if(o){S.video=o.id;S.video_name=o.name}if(c){S.rendition_url=c.url;S.rendition_indicated_bps=c.indicatedBPS;S.rendition_mime_type=c.mimeType;S.rendition_height=c.height;S.rendition_width=c.width}if(_){if(!k(_.mediaRequests)){S.media_requests=_.mediaRequests}if(!k(_.mediaTransferDuration)){S.media_transfer_duration=_.mediaTransferDuration}if(!k(_.mediaBytesTransferred)){S.media_bytes_transferred=_.mediaBytesTransferred}if(!k(_.bandwidth)){S.measured_bps=_.bandwidth}if(!k(_.mediaSecondsLoaded)){S.media_seconds_loaded=_.mediaSecondsLoaded}}if(l>0){S.rebuffering_count=l}if(T>0){S.rebuffering_seconds=T}if(s){let t=0;for(let e=0;e<s.length;e++){const I=s.start(e);const C=s.end(e);if(r>=I&&r<=C){t=C-r;break}}S.forward_buffer_seconds=t}const E=this.history_.filter(e=>e.name==="licenserequestattempted"&&e.time>=t.start&&e.time<t.end);if(E.length){S.license_request_attempts=E.length}if(S.video_duration===Infinity){S.video_seconds_viewed=Math.round(b);delete S.video_duration}else if(b>=1){S["qos.derived_range"]=ds(h,r);S.range=`${f}..${p}`}this.emitAnalyticsEvents_(this.player_,S);return S}sendError(e={}){const t=this.player_.error();if(!t){this.log.debug("skipped error event emission because there was no player error");return}e.streamCount=this.streamCount_;const i=this.resolveData_(e,{event:"error"});const s=x(this.player_.errors)&&x(this.player_.errors.getAll)&&this.player_.errors.getAll()||{unknown:{type:"MEDIA_ERR_UNKNOWN"}};if(t&&s.hasOwnProperty(String(t.code))){i.error_code=s[String(t.code)].type}else if(t.type!==undefined){i.error_code=t.type}else{i.error_code=s.unknown.type}this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogRequest(e,t={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(t,{event:"catalog_request",url:e}))}triggerCatalogRequestError(e,t={}){if(t.error){t.error=wi(t.error,["code","message","type"])}const i=this.resolveData_(t,{event:"catalog_request_error",url:e});this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogResponse(e,t={}){const i=this.resolveData_(t,{event:"catalog_response",url:e});i.response_time_ms=i.time-this.history_.last("catalog_request");this.emitAnalyticsEvents_(this.player_,i)}triggerAdHardTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_hard_timeout"}))}triggerAdModeBegin(e={}){const t=this.player_.ads&&this.player_.ads.pod;const i=o.obj.merge({event:"ad_mode_begin"},Ts(vs,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerAdModeComplete(e={}){const t=this.player_.ads&&this.player_.ads.pod;const i=o.obj.merge({event:"ad_mode_complete"},Ts(vs,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerAdTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_timeout"}))}triggerPlayRequest(e={}){if(this.stateAgent_.state.timeOfPlayRequest){return}this.client_.defaultParams({delivery_type:St(this.player_)?"live":"ondemand"});e.streamCount=this.streamCount_;const t=this.resolveData_(e,{event:"play_request"});this.emitAnalyticsEvents_(this.player_,t);this.stateAgent_.state.timeOfPlayRequest=Number(t.time)}triggerPlayerInit(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_init"}))}triggerPlayerLoad(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_load"}))}}return e};class Is{constructor(){this.optionsQueue_=[];this.state={};this.resetTimesOf()}setOptions(e,t){this.optionsQueue_.push({event:e,options:t})}getOptions(t){const e=this.optionsQueue_.findIndex(({event:e})=>e===t);if(e>-1){const{options:i}=this.optionsQueue_[e];this.optionsQueue_.splice(e,1);return i}}resetTimesOf(){this.state.timeOfImpression=null;this.state.timeOfView=null;this.state.timeOfPlayRequest=null}}const Cs=e=>typeof e==="number"&&!isNaN(e)&&e>=0&&e<Infinity;const ks=e=>e.map(e=>Math.floor(e)).reduce((e,t)=>{const i=e[e.length-1];if(t!==i){e.push(t)}return e},[]);const As=e=>e.reduce((e,t)=>{const i=e[e.length-1];if(i){if(i.end+1===t){i.end=t}else{e.push({start:t,end:t})}}else{e.push({start:t,end:t})}return e},[]);const Ds=e=>e.map(e=>{const{start:t,end:i}=e;const s=i-t;if(s>0){return{start:t,end:i-1,remainder:i}}return{start:t,end:i,remainder:i}});const xs=t=>{const i=[];let{start:s,end:n,remainder:r}=t.shift()||{};while(Cs(s)&&Cs(n)&&Cs(r)&&s===n&&s===r){({start:s,end:n,remainder:r}=t.shift()||{})}if(t.length===0){i.push(r)}for(let e=0;e<t.length;e++){const{start:s,end:n,remainder:r}=t[e];for(let e=s;e<=(r||n);e++){i.push(e)}}return{start:s,end:n,remainders:i,ranges:t.length}};const Os=e=>xs(Ds(As(ks(e))));let Ps=1;function Rs(){return Ps++}const Ls=[];const Ns=function(t,e,i,s,n=true){const r=[].concat(i).sort();if(e!=="removeEventListener"){t.off(r,s)}else{r.forEach(function(e){t.removeEventListener(e,s)})}if(!n){return}let a=Ls.length;while(a--){const o=Ls[a];if(o.context===t&&(o.fn.guid===s.guid||o.fn===s)&&r.every((e,t)=>o.events[t])){Ls.splice(a,1);break}}};const Ms=function(){let e=Ls.length;while(e--){const{context:i,mode:s,events:n,fn:e}=Ls.shift();let t="off";if(s==="addEventListener"){t="removeEventListener"}Ns(i,t,n,e,false)}};const R=function(e,t,i,s){const n=[].concat(i).sort();const r={events:n,fn:s,mode:t,context:e};if(t==="one"||t==="onePerSrc"){r.fn=function(...e){let t="off";if(r.mode==="addEventListener"){t="removeEventListener"}Ns(r.context,t,r.events,r.fn);return s.apply(this,e)};if(!s.guid){s.guid=Rs()}r.fn.guid=s.guid}Ls.push(r);if(t==="addEventListener"){r.events.forEach(e=>{r.context.addEventListener(e,r.fn)})}else{r.context[r.mode](r.events,r.fn)}};const Us=function(){const e=Ls.slice(0);Ms();e.forEach(({context:e,mode:t,events:i,fn:s})=>{R(e,t,i,s)})};const Bs=1e4;const Fs=e=>Boolean(e.onceux&&e.onceux.currentTime&&e.onceux.timeline);const qs=m=>{class e extends m.EventTarget{constructor(e,t){super();this.player_=e;this.log=t.createLogger("Engager");this.stateBySrc_={};this.lastStateRecord_=0;this.disposed_=false}stateBySrc(e=this.player_.currentSrc()){if(!this.stateBySrc_.hasOwnProperty(e)){this.stateBySrc_[e]={buffered:null,duration:0,end:0,height:0,mediainfo:null,playbackRate:1,rebufferingCount:0,src:e,start:0,width:0,playbackStartTime:0,playbackEndTime:0,stats:null,rebuffering:false,rebufferingEnd:0,rebufferingTime:0,rebufferingStart:0,rendition:null,videoPlaybackQuality:null,times:[]}}const t=this.player_.tech_&&this.player_.tech_.vhs;this.stateBySrc_[e].stats=t&&t.stats||null;return this.stateBySrc_[e]}clearStateBySrc(e=this.player_.currentSrc()){this.log.debug("cleared",this.stateBySrc_[e]);delete this.stateBySrc_[e]}updateState(e=this.player_.currentSrc(),t){if(!ht(t)){m.log.warn("Engager.updateState: requires update arg to be an object");return this.stateBySrc(e)}const i=m.obj.merge(this.stateBySrc(e),t);this.stateBySrc_[e]=i;return i}recordState(){const e=this.player_;const t=this.stateBySrc();t.mediainfo=e.mediainfo;t.playbackEndTime=e.currentTime();t.times.push(t.playbackEndTime);if(Fs(e)){t.duration=e.onceux.timeline.contentDuration}else{t.duration=e.duration()}t.buffered=e.buffered();t.playbackRate=e.playbackRate()}isTracking(){return!!this.timerId_}start(e={}){if(this.disposed_){return}let{reason:t,src:i}=e;if(!i){i=this.player_.currentSrc()}const s=this.stateBySrc(i);s.playbackStartTime=s.playbackEndTime=this.player_.currentTime();if(Fs(this.player_)){s.duration=this.player_.onceux.timeline.contentDuration}else{s.duration=this.player_.duration()}s.rebufferingCount=0;s.rebufferingEnd=0;s.rebufferingTime=0;if(e.isRebuffering){s.rebuffering=true;s.rebufferingStart=Date.now()}else{s.rebufferingStart=0}this.player_.clearTimeout(this.timerId_);this.timerCreatedAt_=Date.now();this.timerId_=this.player_.setTimeout(()=>this.stop({src:i,reason:"engagement timer fired"}),Bs);this.log.debug("started",{reason:t,time:this.timerCreatedAt_});return this}prepareState_(e){const t=this.player_;const i=this.stateBySrc(e);const s=t.currentType();i.height=Math.round(t.currentHeight());i.width=Math.round(t.currentWidth());const n=t.tech_&&t.tech_.vhs;if(n&&n.playlists&&n.playlists.media()){const e=n.playlists.media();const c=i.rendition={url:e.resolvedUri,mimeType:s};if(e.attributes){c.indicatedBPS=e.attributes.BANDWIDTH;if(e.attributes.RESOLUTION){c.height=e.attributes.RESOLUTION.height;c.width=e.attributes.RESOLUTION.width}}}if(Pt(m)&&s==="application/vnd.apple.mpegurl"){const u=this.stateBySrc_[this.player_.currentSrc()].parsedManifest||{playlists:[]};const{playlists:d}=u;const h=this.inferRenditions_(d);const f=()=>{if(!h.length){return{url:null,bandwidth:null}}if(h.length>1){return{url:"multiple",bandwidth:"multiple"}}return{url:h[0].uri,bandwidth:h[0].attributes.BANDWIDTH}};const p=f();i.rendition=m.obj.merge(i.rendition,{mimeType:"application/x-mpegurl",height:Math.round(t.videoHeight()),width:Math.round(t.videoWidth()),url:p.url,indicatedBPS:p.bandwidth})}i.videoPlaybackQuality=t.getVideoPlaybackQuality();i.times.push(t.currentTime());const{start:r,end:a,remainders:o,ranges:l}=Os(i.times);i.times=o;return m.obj.merge({rangeExtras:l,rangeStart:r,rangeEnd:a},i)}inferRenditions_(e){if(!e||!Array.isArray(e)||!e.length){return[]}const t=e.every(e=>e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width);if(!t){return e}const c=this.player_.videoWidth();const u=new Set(e.map(e=>e.attributes.RESOLUTION.width).sort((e,t)=>e-t));const d=(e=c,t=Array.from(u))=>{const i=Math.floor((t.length-1)/2);const s=t.slice(0,i+1);const n=t.slice(i+1);const r=s[s.length-1];const a=n[0];if(r===e||a===e){return[e]}if(t.length===1){return t}if(r<e&&a>e){const o=Math.abs(r-e);const l=Math.abs(a-e);if(o===l){return[r,a]}return Math.min(o,l)===o?[r]:[a]}if(r>e){return d(e,s)}if(a<e){return d(e,n)}return[]};const i=d();let s=[];i.forEach(t=>{s=[...s,...e.filter(e=>e.attributes.RESOLUTION.width===t)]});return s}stop(e={}){if(!e.src){e.src=this.player_.currentSrc()}if(this.isTracking()){this.player_.clearTimeout(this.timerId_);this.timerId_=null;const t=this.stateBySrc(e.src);const i=(t.duration-t.playbackEndTime)*1e3;if(!this.player_.ended()&&i>0&&i<1500){this.timerId_=true;this.log.debug("delayed",{msFromEnd:i});R(this.player_,"one","ended",()=>{this.recordState();this.stop({reason:"content ended after we delayed the engager"})});return this}e.state=this.prepareState_(e.src);e.period=e.period||{};e.period.start=e.period.start||this.timerCreatedAt_;e.period.end=e.period.end||Date.now();this.log.debug("stopped",e);this.trigger({type:"engagement",engagement:e})}return this}dispose(){this.disposed_=true;this.stop({ignoreAdState:true,reason:"player disposed"});this.off();return this}}return e};const js=n=>{class e{constructor(e,t){this.log=t;this.player_=e;this.events_=[]}add(e,t=Date.now(),i){const s=n.obj.merge(i,{name:e,time:t});this.events_.push(s);this.log.debug(`saw "${e}" at`,t,i);return t}record(e){const t=Date.now();this.add(e,t,{adState:Pi(this.player_),isInAdState:P(this.player_)});return t}reset(){this.events_.length=0}filter(t){if(!x(t)){return this.events_.filter(e=>e.name===t)}return this.events_.filter(t)}map(e){return this.events_.map(e)}names(){return this.map(e=>e.name)}first(t,i){for(let e=0;e<this.events_.length;e++){const s=this.events_[e];if(!i&&s.isInAdState){continue}if(s.name===t){return s.time}}}last(e,t){let i=this.events_.length;while(i--){const s=this.events_[i];if(!t&&s.isInAdState){continue}if(s.name===e){return s.time}}}}return e};class Vs{constructor(){this.log_={}}put(e){this.log_[e]=true}peek(){return Object.keys(this.log_)}flush(){const e=Object.keys(this.log_);this.log_={};return e}}const a="viewable-percent-change";const $s="viewable-change";class Hs{constructor({player:e,visThreshold:t,duration:i,callback:s}){this.player=e;this.visThreshold=t;this.duration=i;this.callback=s;this.timeout=null;this._visibilityChangeHandler=this._createVisibilityChangeHandler()}_startListening(){this.player.on(a,this._visibilityChangeHandler)}_stopListening(){this.player.off(a,this._visibilityChangeHandler)}_getVisState(){return this.player.viewability().state}_isConsideredVisible({viewablePercent:e}){return e>=this.visThreshold}_createVisibilityChangeHandler(){const e=function(e){if(this._isConsideredVisible(e)){if(!this.timeout){this._startTimeout()}}else if(this.timeout){this._stopTimeout()}};return e.bind(this)}_startTimeout(){this.timeout=this.player.setTimeout(()=>{this.callback();this.shutdown()},this.duration)}_stopTimeout(){Ly.clearTimeout(this.timeout);this.timeout=null}initialize(){if(this._isConsideredVisible(this._getVisState())){this._startTimeout()}this._startListening()}shutdown(){this._stopTimeout();this._stopListening()}}const Gs=/["'&<>]/;const zs=e=>{const t=""+e;const i=Gs.exec(t);if(!i){return t}let s;let n="";let r=0;let a=0;for(r=i.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}if(a!==r){n+=t.substring(a,r)}a=r+1;n+=s}return a!==r?n+t.substring(a,r):n};const Ws={production:"https://metrics.brightcove.com/v2/tracker",qa:"https://metrics.juju.qa.brightcove.com/v2/tracker",staging:"https://metrics.juju.staging.brightcove.com/v2/tracker"};const Ys=(t,i,s)=>{Object.keys(s).forEach(e=>{i[e]=String(i[e]||"");if(e==="accountId"&&!O(i[e])){i[e]=String(i.account||"")}if(!O(i[e])){i[e]=t.getAttribute(`data-${s[e]}`)||""}});return i};const Xs=(e,t)=>{const{accountId:i,applicationId:s,embedId:n,playerId:r}=Ys(e.el(),t,{accountId:"account",applicationId:"application-id",embedId:"embed",playerId:"player",playerName:"name",usage:"usage"});if(!O(t.player)){if(Ly.location.hostname==="players.api.brightcove.com"){t.player=`players.api.brightcove.com/${r}_${n}`;return}t.player=hs(i,r,n);if(s){t.player+="/"+s}}if(s){if(O(t.playerName)){t.playerName+=" - "+s}else{t.playerName=s}}};const Ks=e=>({computedHeight:e.currentHeight(),computedWidth:e.currentWidth(),height:e.height(),width:e.width()});const Qs=(e,t)=>{if(typeof e==="boolean"){t.warn("The __iframe__ option should only be used in tests!");return e}try{return Ly.parent!==Ly.self}catch(e){return true}};const Js=E=>{const w=Ki(E);const I=us(E);const C=ws(E);const k=qs(E);const A=js(E);const e=function(c={}){let r=false;let a=false;const o={};let e;c=E.obj.merge(c);c.env=Ws.hasOwnProperty(c.env)?c.env:"production";Xs(this,c);const l=this.log.createLogger("analytics");const h=new k(this,l);const u=new A(this,l);const d=new Is;const f=new Vs;const t=O(c.usage)?c.usage.split(","):[];t.forEach(function(e){f.put(e)});const p=new I(this,d,O(c.analyticsUrl)?c.analyticsUrl:Ws[c.env],l,{user:c.user,corpCommsApp:c.corpCommsApp,application:c.application,device:c.device,playerId:c.playerId,embedId:c.embedId,applicationId:c.applicationId,requiresConsent:c.requiresConsent});const m=new C(this,p,u,d,l);const i=Es(m);p.defaultParams(()=>{const t={account:c.accountId||null,destination:Ly.location.href,platform:c.platform||"video-js",platform_version:c.platformVersion,player:c.player,player_name:c.playerName,source:Ny.referrer};if(Qs(c.__iframe__,l)){t.destination=Ny.referrer;if(O(c.referrer)){t.source=c.referrer}else{try{t.source=Ly.parent.document.referrer}catch(e){t.source=null}}}return t});R(this,"on","pluginsetup:ads",Us);const s=t=>{[l,p.log,h.log,u.log,m.log].forEach(e=>{if(t){e.level("debug");e.history.enable()}else{e.level("warn");e.history.disable()}})};c.debug=Boolean(c.debug);s(c.debug);this.on("debugon",()=>s(true));this.on("debugoff",()=>s(false));const n=e=>{if(e!==null&&!O(e)){E.log.warn("Authorization Token must be a valid string or null");return}this.analyticsBcovAuthToken_=e};const g=e=>{if(!O(e)){E.log.warn("Player name must be a valid string");return}e=zs(e);p.defaultParams({player_name:zs(e)})};const y=e=>{if(!O(e)){E.log.warn("Application ID must be a valid string");return}e=zs(e);p.applicationId=e};const _=e=>{if(!O(e)){E.log.warn("Viewer ID must be a string");return}p.user(e)};this.bcAnalytics={client:p,emitter:m,engager:h,history:u,setBcovAuthToken:n,setPlayerName:g,setApplicationId:y,setViewerId:_,settings:c,insightsBeacons:i,VERSION:D};R(this,"on","usage",e=>{if(!e.name){return l.warn("Ignored usage event without a `name` parameter")}f.put(e.name)});const v=function(){f.put("pagehide");h.stop({fromUnload:true,ignoreAdState:true,reason:"pagehide called"})};R(Ly,"addEventListener","pagehide",v);const b=e=>{if(!e.usingPlugin("bcAirplay")){return false}if(e.isConnectingToAirplay){e.isConnectingToAirplay=false;return true}};const T=e=>{l.debug(e?`workflow saw "${e.type}"`:"workflow called manually");if(!Ui(e,this)||es(this.player_)){l.debug("workflow bailing because player is in an ad state");return}let t=u.first("loadstart",Ni(this));let i=u.first("play");let s=u.last("playing");l.debug("workflow checking history",{loadstart:t,play:i,playing:s});if(e&&e.type==="playing"&&u.last("pause")){m.triggerVideoResume()}if((i||s)&&!h.isTracking()&&!this.paused()){this.player_.error(null);h.start({period:{start:i||s},reason:"workflow detected that it is playing",isRebuffering:h.stateBySrc().rebuffering})}if(d.state.timeOfImpression&&d.state.timeOfView){return}o.workflow=o.workflow||this.setTimeout(()=>{o.workflow=null;t=u.first("loadstart",Ni(this));i=u.first("play");s=u.last("playing");if((t||i)&&!d.state.timeOfImpression){m.triggerVideoImpression({params:{time:Math.min(t||Infinity,i||Infinity)}})}if(t&&s&&!d.state.timeOfView){l.debug("workflow complete",{order:u.names()});m.triggerVideoView({params:{time:s,analyticsBcovAuthToken:this.analyticsBcovAuthToken_}})}},1)};if(typeof this.ads==="function"){this.adDataStore={adData:Hi,podData:Gi}}const S=()=>{const e=this.player_;if(e.lastPlayerPosition===e.currentTime()&&e.bufferedPercent()===e.lastBufferedPercent&&e.bufferedPercent()<.99){e.isStalled=true}else{e.isStalled=false}e.lastBufferedPercent=e.bufferedPercent();e.lastPlayerPosition=e.currentTime();return e.isStalled};h.on("engagement",e=>{const t=this.player_;const i=t.error();const{fromUnload:s,ignoreAdState:n,period:r,restartAlways:a,state:o}=e.engagement;const l=P(this);const c={useSendBeaconOnly:s,params:{time:r.end}};if(i||S()){t.log('Beacon "video_engagement" blocked due to player error / player being stalled');return}if(o.rangeExtras>=2){f.put("disco-engmnt")}const u=f.peek();if(u&&u.length){c.params.usage=u.map(Ly.encodeURIComponent).sort().join(",")}if(!l||n||es(this.player_)){p.qos.append("frames",o.videoPlaybackQuality);const d=m.triggerVideoEngagement(r,o,c);if(a||d&&!this.paused()){if(l){return}f.flush();h.start({reason:"sent engagement and still playing",isRebuffering:h.stateBySrc().rebuffering})}}});R(this,"on","dispose",()=>{Ms();f.put("disposed");h.dispose()});R(this,"on",w.concat(Yi,Wi).concat("sourceunstable"),e=>{u.record(e.type)});R(this,"on",w.concat("ads-ad-started"),e=>{p.qos.append("event",P(this)?"ad":"content",e.type)});R(this,"on",["loadedmetadata","resize"],()=>{p.qos.append("player",Ks(this))});R(this,"on","fullscreenchange",()=>{const e=Date.now();o.fullscreen=this.setTimeout(()=>{o.fullscreen=null;if(this.isFullscreen()){m.triggerFullscreenEnabled()}else{m.triggerFullscreenDisabled()}p.qos.append("player",Ks(this),e)},500)});R(this,"on","mediachange",()=>{if(this.tech_.vhs){const e=this.tech_.vhs.playlists.media();p.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,playlists:e&&e.attributes&&e.attributes.BANDWIDTH})}});R(this,"on","ratechange",()=>{const e=this.playbackRate().toFixed(2);f.put("pr:"+e)});R(this,"on","pipactive",()=>{m.triggerEnterPIP()});R(this,"on","pipinactive",()=>{m.triggerLeavePIP()});R(this,"on","pin",()=>{m.triggerPin()});R(this,"on","unpin",()=>{m.triggerUnpin()});R(this,"on","texttrackchange",t=>{const i=this.textTracks();if(u.last(t.type)){const e=u.filter(t.type);const s=e[e.length-1].text_track_index;m.triggerTextTrackDisabled({params:{text_track_kind:i[s].kind,text_track_language:i[s].language}})}for(let e=0;e<i.length;e++){if(i[e].mode==="showing"){u.add(t.type,new Date,{text_track_index:e});m.triggerTextTrackEnabled({params:{text_track_kind:i[e].kind,text_track_language:i[e].language}});break}}});R(this,"on","volumechange",()=>{if(this.muted()&&!e){e=true;m.triggerMuteEnabled()}if(!this.muted()&&e){e=false;m.triggerMuteDisabled()}if(!this.muted()){m.triggerVolumeChange({params:{volume:this.volume()}})}});R(this,"on","ready",()=>{e=this.muted();R(this.tech_,"on","usage",e=>{if(!e.name){return l.warn("Ignored usage event without a `name` parameter")}f.put(e.name)});R(this.tech_,"on","bandwidthupdate",()=>{p.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,throughput:Math.round(this.tech_.vhs.throughput)})});R(this.tech_,"on","liveresync",()=>{this.trigger({type:"usage",name:"hls-live-resync"})});R(this.tech_,"on","videounderflow",()=>{this.trigger({type:"usage",name:"hls-video-underflow"})});R(this.tech_,"on","licenserequestattempted",()=>{u.add("licenserequestattempted")});R(this,"on","loadedmetadata",()=>{const i=this.player_.currentSrc();const e=E.url.parseUrl(i);const t=e.hostname.indexOf("boltdns.net")===-1;const s=Boolean(h.stateBySrc(i)&&h.stateBySrc(i).parsedManifest);const n=this.currentType();const r=typeof c.nativeQoe==="boolean"?c.nativeQoe:!t;if(Pt(E)&&_t(n)&&r&&!s){const o=Nt(i,E);o.then(e=>{const t=Mt(e,Ei);h.updateState(i,{parsedManifest:t})},e=>{E.log.error(e)})}const a=this.textTracks();for(let e=0;e<a.length;e++){if(a[e].label==="segment-metadata"){const l=a[e];let i;R(l,"addEventListener","cuechange",()=>{const e=l.activeCues[0];if(e){const t=this.tech_.vhs.playlists.main.playlists[e.value.playlist];if(i!==t.uri){if(t.attributes&&t.attributes.BANDWIDTH){p.qos.append("bitrate",{rendered:t.attributes.BANDWIDTH})}if(i!==undefined){h.stop({reason:"rendition on screen changed",restartAlways:true})}}i=t.uri}})}}if(this.usingPlugin("social")){R(this.socialButton,"on","click",()=>{m.triggerShareOverlay()});R(this.socialOverlay,"on","click",e=>{if(e.target.classList.contains("vjs-social-share-link")){m.triggerShareSocialClicked({params:{share_network:e.target.getAttribute("title").toLowerCase()}})}});R(this.socialOverlay,"on","copy",e=>{if(e.target.parentElement.classList.contains("vjs-social-direct-link")){m.triggerShareLinkCopied({params:{link_url:this.socialOverlay.getDirectLink()}})}else if(e.target.parentElement.classList.contains("vjs-social-embed-code")){m.triggerShareEmbedCopied({params:{embed_code:this.socialOverlay.getEmbedCode()}})}})}if(St(this.player_)&&this.player_.liveTracker){R(this.player_.liveTracker,"on","liveedgechange",()=>{p.defaultParams({delivery_type:this.player_.liveTracker.behindLiveEdge()?"dvr":"live"})})}})});R(this,"on","waiting",e=>{const t=this.currentTime()===0&&!this.paused();if(!a&&!t&&!P(this)&&!h.stateBySrc().rebuffering){h.stateBySrc().rebuffering=true;h.stateBySrc().rebufferingCount++;h.stateBySrc().rebufferingStart=Date.now()}R(this,"one",["playing","pause"],()=>{if(h.stateBySrc().rebuffering){h.stateBySrc().rebufferingEnd=Date.now();const e=(h.stateBySrc().rebufferingEnd-h.stateBySrc().rebufferingStart)/1e3;const t=h.stateBySrc().rebufferingTime+e;const i=parseFloat(t.toFixed(1));h.stateBySrc().rebufferingTime=i;h.stateBySrc().rebuffering=false}})});R(this,"on","sourcechanged",(e,t)=>{const i=t.interimEvents;const s=i[0].event;const n=()=>{if(!a&&!P(this)){h.recordState()}};l.debug("sourcechanged",{by:s.type,interim:i.map(e=>e.event.type),from:t.from,to:t.to});if(t.from){h.stop({reason:"changing sources",period:{end:i[0].time},ignoreAdState:true,src:t.from});h.clearStateBySrc(t.from)}r=false;a=false;d.resetTimesOf();u.reset();i.forEach(e=>u.add(e.event.type,e.time));T();R(this,"onPerSrc","timeupdate",n);R(this,"onePerSrc","sourceunstable",()=>{if(Pi(this)==="content-resuming"){return}const e=this.currentSrc();h.stop({ignoreAdState:true,reason:"sourceunstable",src:e});if(!P(this)){Ns(this,"off","timeupdate",n)}});R(this,"onPerSrc",["loadstart","play","playing"],T);R(this,"onPerSrc",["pause","ratechange"],e=>{if(e.type==="pause"){u.record(e.type);m.triggerVideoPause()}if(!a&&!P(this)&&!this.ended()){h.stop({reason:`saw "${e.type}"`});if(this.paused()){R(this,"onePerSrc","playing",()=>{h.start({reason:"playback began after a pause",isRebuffering:h.stateBySrc().rebuffering})})}else if(e.type==="ratechange"){o.ratechange=this.setTimeout(()=>{o.ratechange=null;h.start({reason:"the playback rate changed",isRebuffering:h.stateBySrc().rebuffering})},1)}}});R(this,"onPerSrc","unstable",()=>{if(!a&&!P(this)){a=true;h.stop({reason:"seeking"})}});R(this,"onPerSrc","seek",()=>{if(a&&!P(this)){a=false;h.start({reason:"stopped seeking",isRebuffering:h.stateBySrc().rebuffering})}});R(this,"onePerSrc","adstart",()=>{if(!Ri(this)||es(this.player_)){m.triggerVideoImpression({params:{time:u.last("adstart",true)-100}})}});R(this,"onPerSrc","adstart",()=>{r=this.ended();h.stop({ignoreAdState:true,period:{end:u.last("adstart",true)},reason:"saw adstart"})});R(this,"onePerSrc","adend",()=>{if(!this.paused()&&!this.ended()){T()}});R(this,"onPerSrc","adend",()=>{if(!r){h.start({reason:'saw "adend"'})}})});R(this,"on","catalog_request",e=>{u.record(e.type);m.triggerCatalogRequest(e.url)});R(this,"on","catalog_request_error",e=>{u.record(e.type);m.triggerCatalogRequestError(e.url,{error:e.error,xhr:e.response})});R(this,"on","catalog_response",e=>{u.record(e.type);m.triggerCatalogResponse(e.url,{xhr:e.response})});R(this,"on","play",e=>{if(Mi(this)||b(this)||u.first("play")!==u.last("play")){return}const t={params:{time:Date.now()}};if(this.perSourceBehaviors.isSrcStable()){m.triggerPlayRequest(t)}else{R(this,"one","sourcechanged",()=>{m.triggerPlayRequest(t)})}});R(this,"on","error",()=>{if(!P(this)){m.sendError()}});R(this,"on","adstart",()=>{m.triggerAdModeBegin();o.perSrcDisable=this.setTimeout(()=>{o.perSrcDisable=null;this.perSourceBehaviors.disable()},1);this.one("playing",function(){const e=u.filter(e=>e.name==="playing").length;if(e>1){m.triggerVideoResumed()}})});R(this,"on","adend",()=>{m.triggerAdModeComplete();if(o.perSrcDisable){this.clearTimeout(o.perSrcDisable)}else{this.perSourceBehaviors.enable()}});R(this,"on","adserror",e=>{const t=e.adData||this.ads&&this.ads.ad;m.triggerAdError({params:{ad_error:e.errorCode}},t)});R(this,"on","adtimeout",()=>{m.triggerAdTimeout()});R(this,"on","ad-hard-timeout",()=>{m.triggerAdHardTimeout()});R(this,"on",Qi,e=>{ji(p,e.type,Date.now())});R(this,"on","ads-ad-started",e=>{const t=new Hs({player:this,visThreshold:.5,duration:2e3,callback:()=>{this.bcAnalytics.insightsBeacons.adViewableImpression()}});t.initialize();this.any(["ads-ad-ended","adend","adtimeout","adserror"],()=>{t.shutdown()})});p.qos.append("mr",c.mr);p.qos.append("locked",c.playerVersionLocked);if(x(c.beforeFirstBeacon)){c.beforeFirstBeacon(this)}m.triggerPlayerInit();m.sendError();R(this,"one","ready",()=>{p.defaultParams({feature:Ri(this)?"adonly":null,autoplay:this.autoplay(),ads_enabled:this.ads!==undefined});p.qos.append("performance",(Ly.location.href||"").split("?")[1]);p.qos.append("player",Ks(this));if("hidden"in Ny&&"visibilityState"in Ny){if(Ny.hidden){this.trigger({type:"usage",name:"document-hidden"})}const e=()=>{this.trigger({type:"usage",name:"document-"+Ny.visibilityState})};R(Ny,"addEventListener","visibilitychange",e)}if(Ny.querySelector(".bc-iframe")){this.trigger({type:"usage",name:"iframe-embed"})}else{this.trigger({type:"usage",name:"inpage-embed"})}m.triggerPlayerLoad({qos:p.qos.keys(),params:{usage:f.flush()}})})};e.VERSION=D;E.registerPlugin("bcAnalytics",e);return e};const Zs="video";const A="playlist";const L="search";const en="lazySequence";const tn="related";const sn=[{attr:"data-video-id",query:"videoId",config:"videoId",type:Zs},{attr:"data-playlist-id",query:"playlistId",config:"playlistId",type:A},{attr:"data-catalog-search",query:"catalogSearch",config:"search",type:L},{attr:"data-catalog-sequence",query:"catalogSequence",config:"sequence",type:en}];const nn=(t,i,s)=>{for(let e=0;e<sn.length;e++){const n=sn[e];const r=n[t];if(i[r]){const e={id:i[r],type:n.type};if(e.type===A){e.playlistVideoId=s}return e}}};const rn=l=>{const e=(s,e,t)=>{const i=e.options_;const n=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const r=W.qs();t=t?r.parse(t):r.search;sn.concat({query:"playlistVideoId"}).forEach(({query:e})=>{if(Array.isArray(t[e])){t[e]=t[e].pop()}});if(sn.filter(e=>!!s[e.config]).length>1||sn.filter(e=>!!i[e.attr]).length>1){e.error({headline:"Bad Request: Multiple catalog media queries provided. Please only provide one",type:"PLAYER_ERR_CONFLICTING_DATA",code:-3,message:"Too many catalog media parameters were provided in this player. "+"Please use only one of the following: videoId, playlistId, catalogSequence, or catalogSearch."});return}const a=n&&nn("query",t,t.playlistVideoId)||nn("attr",i,i["data-playlist-video-id"]||t.playlistVideoId)||nn("config",s,t.playlistVideoId||s.playlistVideoId);if(!a){return}if(typeof a.id==="string"&&(a.type===L||a.type===en)){const o=a.id;try{a.id=JSON.parse(o)}catch(e){if(a.type===en){l.log.error("sequence must be valid JSON or an object",e);return}}if(!W.isObj(a.id)&&!Array.isArray(a.id)){a.id=o}}["adConfigId","deliveryConfigId","bumper"].forEach(t=>{const i=t==="bumper"?s[t]&&s[t].id:s[t];if(!W.isNonEmptyStr(i)){return}if(W.isObj(a.id)){a.id[t]=i}else if(Array.isArray(a.id)){a.id.forEach(e=>{e[t]=i})}else{a[t]=s[t]}});return a};return e};const n={VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND:{headline:"The Video Cloud account was not found."},VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND:{headline:"The Video Cloud resource was not found."},VIDEO_CLOUD_ERR_NOT_PLAYABLE:{headline:"The Video Cloud video is not playable."},VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND:{headline:"The Video Cloud SSAI ad config id was not found."},VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND:{headline:"The Video Cloud video was not found."},VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS:{headline:"Invalid Request: Duplicate Parameter",message:"The same parameter name was provided more than once in the request."},VIDEO_CLOUD_ERR_TOKEN_REQUIRED:{headline:"Access Denied: Missing Token",message:"Video cannot be played without a token."},VIDEO_CLOUD_ERR_TOKEN_INVALID:{headline:"Access Denied: Invalid Token",message:"Video cannot be played without a valid token."},VIDEO_CLOUD_ERR_UNKNOWN:{headline:"The Playback API request failed for an unknown reason",message:"Unknown catalog request error."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"Playback Denied: Domain Restricted",message:"Video is not playable on this domain."},PLAYER_ERR_IP_RESTRICTED:{headline:"Playback Denied: IP",message:"Your IP address does not have access to this video."},PLAYER_ERR_GEO_RESTRICTED:{headline:"Playback Denied: Location",message:"Video is unavailable from your current location."},PLAYER_ERR_OFFER_RESTRICTED:{headline:"Playback Denied: Offer Restricted",message:"Video is not playable with your entitlements."},PLAYER_ERR_TAG_RESTRICTED:{headline:"Playback Denied: Tags",message:"Video does not have tags required for playback."},PLAYER_ERR_ACCOUNT_ID:{headline:"Playback Denied: Account ID",message:"Account ID missing or invalid."},PLAYER_ERR_DEVICE_RESTRICTED:{headline:"Playback Denied: Device",message:"Device does not have access to this resource."},VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Video is not currently available for playback."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Playlist is not currently available for playback."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE:{code:"DENIED_BY_STREAM_LIMIT_CREATE",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW:{code:"DENIED_BY_STREAM_LIMIT_RENEW",headline:"Stream Limiting: Existing Viewers",message:"Limited stream is already being watched by the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING:{code:"DENIED_BY_STREAM_LIMITING",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING:{code:"DENIED_BY_DEVICE_LIMITING",headline:"Device Limiting: New Viewers",message:"Maximum number of streams has been reached on this device."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND:{headline:"Playlist Unavailable: Not Found",message:"Playlist cannot be found."},VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED:{headline:"API: Method not allowed."},VIDEO_CLOUD_ERR_SERVER:{headline:"Server: Internal server error",message:"An internal server error prevented playback."},VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE:{headline:"Server Error: Video",message:"Video unavailable."},VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE:{headline:"Server Error: Account",message:"Account unavailable."},VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE:{headline:"Server Error: Video URLs",message:"Stream URLs unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE:{headline:"Server Error: Playlist",message:"Video playlist unavailable."},VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE:{headline:"Server Error: Playback Rights",message:"Entitlements unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE:{headline:"Server Error: Playlist Videos",message:"Playlist videos unavailable."},VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE:{headline:"Server Error: License",message:"Stream license unavailable."},VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE:{headline:"Server Error: Offers",message:"Stream offers unavailable."},VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE:{headline:"Server Error: Rights",message:"Stream rights unavailable."},VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE:{headline:"Server Error: Unavailable",message:"The server is currently unavailable. Please try again later."},VIDEO_CLOUD_ERR_SERVICE_TIMEOUT:{headline:"Server Error: Timeout",message:"Recevied a timeout from the server. Please try again later."},GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING:{headline:"Session Limiting: New Sessions",message:"Maximum number of sessions have been reached for this video",dismiss:false},GSC_TOKEN_REQUIRED:{headline:"Invalid Request: JWT is required",message:"Please provide a valid token",dismiss:false},GSC_INVALID_TOKEN:{headline:"Invalid Request: Invalid JWT",message:"Please provide a valid token",dismiss:false},GSC_MISSING_FIELD_ACCOUNT_ID:{headline:"Invalid Request: AccountID is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_UID:{headline:"Invalid Request: UID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_SESSION_ID:{headline:"Invalid Request: SID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_CLIMIT:{headline:"Invalid Request: CLIMIT in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_VIDEO_ID:{headline:"Invalid Request: videoId is required",message:"Please provide required information",dismiss:false},GSC_SESSION_STOPPED:{headline:"Stream Limiting: Session stopped",message:"Stream session no longer available",dismiss:false},GSC_SESSION_EXPIRED:{headline:"Stream Limiting: Session expired",message:"Stream session no longer available",dismiss:false},GSC_PLAYBACK_RESTRICTIONS:{headline:"Playback Restrictions: Not Met",message:"Playback restrictions requirements have not been met",dismiss:false},GSC_SESSION_NOT_FOUND:{headline:"Not found",message:"Playback session not found",dismiss:false},GSC_VIDEO_NOT_FOUND:{headline:"Not found",message:"Video cannot be found or does not exist",dismiss:false}};const an=(e,t)=>{const i=e.error();if(t===null&&i&&(i.headline===n.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE.headline||i.headline===n.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW.headline||i.headline===n.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING.headline||i.headline===n.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING.headline||i.headline===n.GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING.headline)){return i}if(t&&t.code===5&&/Denied by stream limiting \(create\)/.test(t.cause)){return n.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE}if(t&&t.code===5&&/Denied by stream limiting \(renew\)/.test(t.cause)){return n.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW}if(t&&t.code===5&&/Denied by stream limiting/.test(t.cause)){return n.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING}if(t&&t.code===5&&/Denied by device limiting: [1-9] devices in use/.test(t.cause)){return n.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING}return t};const on=e=>{const t=()=>e.errors.extend(n);const i=W.isFn(e.usingPlugin)?e.usingPlugin("errors"):W.isFn(e.errors)&&W.isFn(e.errors.extend);if(!i){e.on("pluginsetup:errors",t);e.on("dispose",()=>{e.off("pluginsetup:errors",t)});return}t()};const ln={400:{AD_CONFIG_NOT_FOUND:"VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND",DUPLICATE_PARAMETERS:"VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS"},401:{TOKEN_REQUIRED:"VIDEO_CLOUD_ERR_TOKEN_REQUIRED",TOKEN_VALIDATION:"VIDEO_CLOUD_ERR_TOKEN_INVALID"},403:{ACCESS_DENIED:{DOMAIN:"PLAYER_ERR_DOMAIN_RESTRICTED",CLIENT_IP:"PLAYER_ERR_IP_RESTRICTED",CLIENT_GEO:"PLAYER_ERR_GEO_RESTRICTED",OFFERS:"PLAYER_ERR_OFFER_RESTRICTED",TAGS:"PLAYER_ERR_TAG_RESTRICTED",ACCOUNT_ID:"PLAYER_ERR_ACCOUNT_ID",DEVICE:"PLAYER_ERR_DEVICE_RESTRICTED"},VIDEO_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE",PLAYLIST_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE",DENIED_BY_STREAM_LIMITING_CREATE:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE",DENIED_BY_STREAM_LIMITING_RENEW:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW",DENIED_BY_STREAM_LIMITING:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING",DENIED_BY_DEVICE_LIMITING:"VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING"},404:{ACCOUNT_NOT_FOUND:"VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND",RESOURCE_NOT_FOUND:"VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND",PLAYLIST_NOT_FOUND:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND"},405:{METHOD_NOT_ALLOWED:"VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED"},500:{SERVER_ERROR:"VIDEO_CLOUD_ERR_SERVER"},502:{VIDEO_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE",VIDEO_URLS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE",PLAYLIST_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE",PLAYLIST_VIDEOS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE",ACCOUNT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE",PLAYBACK_RIGHT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE",LICENSE_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE",OFFERS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE",RIGHTS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE"},503:{SERVICE_UNAVAILABLE:"VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE"},504:{SERVER_TIMEOUT:"VIDEO_CLOUD_ERR_SERVICE_TIMEOUT"}};const cn=(e,t)=>{const i=t.shift();if(W.isNonEmptyStr(e[i])){return e[i]}if(!i||!e[i]){return"VIDEO_CLOUD_ERR_UNKNOWN"}return cn(e[i],t)};const un=(e,t)=>{t=Array.isArray(t)?t[0]:t||{};return{code:cn(ln,[e,t.error_code,t.error_subcode])}};const dn=(i,s)=>{return(e,t)=>{if(e){e.data=t;i.catalog.error=e;i.error(un(e.status,t));return i.trigger("bc-catalog-error")}i.ready(()=>i.catalog.load(s(t)))}};const hn=a=>{const o=(e,t,i)=>{if(i.embedHasPoster){e.poster=t.options_.poster}if(i.embedHasSources){e.sources=t.options_.sources}if(i.embedHasTracks){e.textTracks=t.options_.tracks}if(e.textTracks&&e.textTracks.length>0&&a.browser.IS_ANY_SAFARI){t.$(".vjs-tech").setAttribute("crossorigin","anonymous")}return e};const e=(s,n,r)=>{if(s===Zs){return dn(n,e=>o(e,n,r))}return dn(n,t=>{const e=o({},n,r);if(Array.isArray(t.videos)){const i=t.videos[0]||{};t.videos[0]=a.obj.merge(i,e,{rawItem:i})}else{t.videos=[e]}if(r.playlistVideoId&&s===A){for(let e=0;e<t.length;e++){if(t[e].id===r.playlistVideoId||`ref:${t[e].referenceId}`===r.playlistVideoId){t.startingIndex=e;break}}}return t})};return e};const fn=()=>Number.MAX_SAFE_INTEGER||Math.pow(2,53)-2;const pn=(e,t)=>{const i=e.cuePoints;const s=i[t];let n;for(t++;t<i.length;t++){if(i[t].time>s.time){n=i[t];break}}const r=isFinite(e.duration)?e.duration:fn();s.startTime=s.time;if(n&&n.time<r){s.endTime=n.time}else{s.endTime=r}return s};const mn=t=>{const i=t.remoteTextTracks();if(i){let e=i.length;while(e--){t.removeRemoteTextTrack(i[e])}}const s=t.textTracks();if(s){let e=s.length;while(e--){const n=s[e];if(n.kind==="metadata"&&n.cues){let e=n.cues.length;while(e--){n.removeCue(n.cues[e])}}n.mode="disabled"}}};const gn=(e,t)=>{mn(e);if(!t.cuePoints){return}const i=e.mediaCuePointsTrack();const s=Ly.VTTCue||Ly.vttjs&&Ly.vttjs.VTTCue||Ly.TextTrackCue;for(let e=0;e<t.cuePoints.length;e++){const n=t.cuePoints[e];const r=new s(n.startTime,n.endTime,n.type);r.originalCuePoint=n;i.addCue(r)}i.mode="hidden"};const yn=function(e,t,i){let s=0;for(;s<e.length;s++){if(t(e[s])){return e[s]}}return i};function _n(e){const t=_n.windowLocationProtocol();const i=function(e){return e.src&&e.src.indexOf(t)===0};if(e&&e.length&&e.length>0){return yn(e,i,e[0]).src}}_n.windowLocationProtocol=function(){return Ly.location.protocol};const vn=(e,t)=>`https://${e}.api.${t?t+".":""}brightcove.com/playback/v1/`;const bn={production:{papi:vn("edge"),epa:vn("edge-auth")},qa:{papi:vn("edge","qa"),epa:vn("edge-auth","qa")},staging:{papi:vn("edge","staging"),epa:vn("edge-auth","staging")}};const Tn=e=>Ly.encodeURIComponent(e);const Sn=e=>typeof e==="string"&&/^BCpk/.test(e);const En=i=>{const s={ad_config_id:"adConfigId",config_id:"deliveryConfigId"};const e=["ad_config_id","config_id","tveToken"];if(i.type!==Zs){e.push("limit");e.push("offset")}if(i.type===L){e.push("q");e.push("sort")}const n={};e.forEach(e=>{const t=s[e]||e;if(i[t]){n[e]=i[t]}});const t=W.qs().stringify(n);return t?"?"+t:""};const wn=(e,t)=>{let{env:i,type:s}=t;if(!i){i="production"}let n;if(W.isNonEmptyStr(t.baseUrl)){n=t.baseUrl}else if(Sn(t.policyKey)){n=bn[i].papi}else{n=bn[i].epa}if(n.slice(-1)==="/"){n=n.slice(0,-1)}let r;r=`${n}/accounts/${Tn(e)}/${s===A?"playlists":"videos"}`;if(s!==L){r+="/"+Tn(t.id)}if(s===tn){r+="/related"}r+=En(t);return r};const In=y=>{const e=function(i,s,e,n=()=>{}){const{deliveryConfigId:r,adConfigId:a,id:o,bcovAuthToken:t,policyKey:l,q:c,type:u}=e;if(!s||!u){return n(new Error("accountId and type are required"))}if(u===L&&!c){return n(new Error("q is required when performing a search"))}else if(u!==L&&!o){return n(new Error("id is required when getting a video or playlist"))}const d=wn(s,e);const h=(e,t)=>{i.trigger(W.assign({type:`catalog_${e}`,accountId:s,deliveryConfigId:r,adConfigId:a,playlistId:u===A?o:undefined,related:u===tn?o:undefined,search:u===L?c:undefined,url:d,videoId:u===Zs?o:undefined},t))};const f=(e,t,i)=>h("request_error",{error:e,response:t,body:i});h("request");const p={};if(Sn(l)){p.Accept="application/json;pk="+l}else if(t){p.Authorization="Bearer "+t}const m=y.xhr({headers:p,json:true,url:d},(e,t,i)=>{if(e){f(e,m,i);return n(e,i)}if(m.status>=400){f(new Error("Request Failed"),m,i);return n(m,i)}h("response",{response:m});n(null,i)});const g=m.onabort.bind(m);m.onabort=()=>{const e=new Error("Request Aborted");g();f(e,m,null);return n(e,null)};return m};return e};const Cn="https://fps.brightcove.com/v1/application_certificate";const kn="com.apple.fps.1_0";const An=e=>{return Ly.btoa(String.fromCharCode.apply(null,e))};const Dn=e=>{return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};const xn=({source:e,publisherId:t,applicationId:i})=>{const s=e.key_systems[kn].certificate_url;if(s){return s}if(i&&t){return`${Cn}/${t}/${i}`}return null};const On=s=>{const e=(e,i)=>{const t=xn({source:e.source,publisherId:e.publisherId,applicationId:e.applicationId});s.xhr({uri:t,responseType:"arraybuffer"},s.xhr.httpHandler((e,t)=>{if(e){i(e);return}i(null,new Uint8Array(t))}))};return e};const Pn=(e,t)=>{if(typeof t==="string"){return t.split("//")[1]}return Dn(t).split("//")[1]};const Rn=c=>{const e=(o,l)=>{return(e,t,i,s)=>{const n=t.split("&").filter(e=>/^renditionType/.test(e))[0]||"";const r=n.split("=")[1];const a={"Content-Type":"application/json",Accept:"application/octet-stream"};if(e.emeHeaders&&e.emeHeaders["BCOV-Auth"]){a["BCOV-Auth"]=e.emeHeaders["BCOV-Auth"]}if(r&&l){o=l[r]}c.xhr({uri:o,method:"POST",responseType:"arraybuffer",json:{publisher_id:e.publisherId,application_id:e.applicationId,key_id:t.split("/")[3],server_playback_context:An(i)},headers:a},c.xhr.httpHandler(s,true))}};return e};var p={getCertificateUri:xn,initGetCertificate:On,getContentId:Pn,initCreateGetLicenseFunc:Rn,base64EncodeUint8Array:An,FAIRPLAY_KEY_SYSTEM:kn};const Ln=(e=[])=>e.filter(e=>e.keySystems&&e.keySystems[p.FAIRPLAY_KEY_SYSTEM]);const Nn=(e,t,n)=>{const i=Ln(t);if(!i.length||!e.eme){n();return}const s=e.eme.options||{};let r=0;const a=[];const o={};for(let e=0;e<i.length;e++){const l=i[e];const c=p.getCertificateUri({source:l,publisherId:s.publisherId,applicationId:s.applicationId});if(!c){continue}if(o[c]){o[c].push(l);continue}r++;o[c]=[l];l.keySystems[p.FAIRPLAY_KEY_SYSTEM].getCertificate({source:l,publisherId:s.publisherId,applicationId:s.applicationId},(e,i)=>{if(e){a.push({message:"Unable to resolve FairPlay certificate",error:e})}else{const t=o[c];for(let e=0;e<t.length;e++){const s=t[e];s.keySystems[p.FAIRPLAY_KEY_SYSTEM].getCertificate=(e,t)=>{t(null,i)}}}r--;if(!r){if(a.length){n(a);return}n()}})}};const Mn=(e,t)=>{const i=p.initCreateGetLicenseFunc(t);const s=p.initGetCertificate(t);if(!W.isHlsType(e.type)||!e.key_systems||!e.key_systems[p.FAIRPLAY_KEY_SYSTEM]){return null}const n=e.key_systems[p.FAIRPLAY_KEY_SYSTEM];const r=n.key_request_url;const a={};a[p.FAIRPLAY_KEY_SYSTEM]={getCertificate:s,getLicense:i(r,n.key_request_urls),getContentId:p.getContentId};return a};const Un=t=>{const e=e=>{return Mn(e,t)};return e};var Bn={initGetKeySystemOptions:Un,getFairPlaySources:Ln,resolveFairPlayCertificates:Nn};const Fn=(e,t)=>{t=t||e&&e.mediainfo||{};return e&&e.hasPlugin&&e.hasPlugin("vr")&&t&&t.projection};const qn=50*1024*1024;const jn=3*1024*1024;const Vn=.5*1024*1024;const $n={http:{nativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},noNativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},preferMp4:{http:{"application/vnd.apple.mpegurl":3,"video/mp4":1,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":4,"video/mp4":2,"application/dash+xml":6}}},https:{nativeHls:{http:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":1,"video/mp4":4,"application/dash+xml":3}},noNativeHls:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":1,"video/mp4":3,"application/dash+xml":2}},preferMp4:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":2,"video/mp4":1,"application/dash+xml":3}}},codecs:{switching:{hevc:{combined:1,hevc:2,avc:3},nohevc:{combined:5,hevc:6,avc:4}},noswitching:{hevc:{combined:3,hevc:5,avc:2},nohevc:{combined:4,hevc:6,avc:1}}}};const Hn={1:3,2:3.2,3:4.2,4:5,5:6,6:7,7:8};const Gn=(e,t)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&W.isSafariWithFairplaySupport()&&e.eme&&e.eme.options};const zn=(e,t,i)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&W.isBrowserWithWidevineSupport(i)&&e.eme&&e.eme.options};const Wn=function(e,t,i,s,n){t.priority=9999;if(!t.src){return 9999}if(t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&(t.key_systems["com.apple.fps.1_0"]&&!Gn(i,t)||t.key_systems["com.widevine.alpha"]&&!zn(i,t,n))){return 9999}if(t.profiles&&t.profiles.match(/hbbtv/i)){return 9999}if(n.browser.IS_IOS&&t.type==="application/vnd.apple.mpegurl"&&Hn[t.ext_x_version]>parseFloat(n.browser.IOS_VERSION)){return 9999}e=e[/^[^:]*/.exec(t.src)];if(!e){return 9999}if(e[t.type]){t.priority=e[t.type]}const r=t.codecs&&t.codecs.indexOf("avc1")!==-1;const a=t.codecs&&t.codecs.indexOf("hvc1")!==-1;const o=r&&a;let l;if(o){l=s.combined}else if(a){l=s.hevc}else if(r){l=s.avc}else{l=0}return t.priority+l};const N=g=>{const y=function(e,t,i,s,n){let r=N.preferHttps()?$n.https:$n.http;let a;if(Fn(e,t)){a=qn}else if(g.browser.IS_IOS||g.browser.IS_ANDROID){a=Vn}else{a=jn}if(N.preferMp4(e,t)){r=r.preferMp4}else if(N.supportsNativeHls()){r=r.nativeHls}else{r=r.noNativeHls}let o=Wn(r,s,e,i,g)-Wn(r,n,e,i,g);const l=s.type==="application/vnd.apple.mpegurl"&&s.codecs&&s.ext_x_version||n.type==="application/vnd.apple.mpegurl"&&n.codecs&&n.ext_x_version;const c=s.codecs&&n.codecs?false:true;if(l&&c){o=s.priority-n.priority}delete s.priority;delete n.priority;if(o){return o}if(s.type==="video/mp4"&&n.type==="video/mp4"){if(s.avg_bitrate&&n.avg_bitrate){return Math.abs(s.avg_bitrate-a)-Math.abs(n.avg_bitrate-a)}if(s.avg_bitrate||n.avg_bitrate){o=s.avg_bitrate?-1:1}}if(s.type==="application/vnd.apple.mpegurl"&&n.type==="application/vnd.apple.mpegurl"){if(s.ext_x_version&&n.ext_x_version){return n.ext_x_version-s.ext_x_version}if(s.ext_x_version||n.ext_x_version){o=s.ext_x_version?-1:1}}return o};function e(t,e,i={}){const s=Bn.initGetKeySystemOptions(g);const n=e.sources||[];const r=[];let{bcovAuthToken:a,policyKey:o,watermarkingToken:l,allowPlayreadyInChromiumEdge:c}=i;const u=!!a&&o===null;if(a&&!W.isNonEmptyStr(a)){g.log.error("The bcovAuthToken catalog property must be a string");a=null}if(l&&!W.isNonEmptyStr(l)){g.log.error("The watermarking token catalog property must be a string");l=null}for(let e=0;e<n.length;e++){const p=n[e];if(p.key_systems&&p.key_systems["com.microsoft.playready"]&&W.isChromiumEdge(g)&&(u&&typeof c==="undefined"||c===false)){if(Object.keys(p.key_systems).length>1){delete p.key_systems["com.microsoft.playready"]}else{n.splice(e,1);e--;continue}}if(a&&p.key_systems){p.emeHeaders={"BCOV-Auth":a}}if(l){p.src=p.src.replace("{WMT}",l)}if(p.src&&p.container==="MP4"){p.type="video/mp4"}else if(p.src&&(p.container==="M2TS"||W.isHlsType(p.type))){p.type="application/vnd.apple.mpegurl";if(Gn(t,p)){p.keySystems=s(p)}if(W.isEncryptedHls(p,g)&&a){if(p.vmap&&t.hasPlugin("ssai")){p.bcovAuthToken=a}else{const m=g.url.parseUrl(p.src);let e="bcov_auth="+a;if(!m.search){e="?"+e}else if(!(m.search[m.search.length-1]==="&")){e="&"+e}p.src+=e}}}r.push(p)}const d=N.supportsSwitchingCodecs(t)?"switching":"noswitching";const h=N.supportsHEVC()?"hevc":"nohevc";const f=$n.codecs[d][h];return r.sort(y.bind(null,t,e,f))}N.supportsNativeHls=function(){return W.isNativeHlsSupported(g)};N.preferHttps=function(){return W.preferHttps(Ly)};N.supportsHEVC=function(){return W.isHevcSupported()};N.supportsSwitchingCodecs=function(e){return W.isCodecSwitchingSupported(e)};N.preferMp4=function(e,t){return g.browser.IS_ANDROID&&g.browser.ANDROID_VERSION<5||Fn(e,t)};return e};class Yn{constructor(){this.defaults_={}}normalize(e,t,i){const s=W.assign({},this.defaults_);if(e&&!W.isObj(e)){s.id=e}else{W.assign(s,e);if(W.isObj(e.id)){W.assign(s,e.id);if(!e.id.hasOwnProperty("id")){delete s.id}}}if(typeof t==="string"){s.type=t}if(s.type===L){if(!s.q){s.q=s.id}delete s.id}if(typeof e.deliveryConfigId==="string"){s.deliveryConfigId=e.deliveryConfigId}if(typeof i==="string"){s.adConfigId=i}if((s.type===A||s.type===L)&&s.limit===undefined){s.limit="100"}return s}setDefaults(e){if(e===null){this.defaults_={}}else{W.assign(this.defaults_,e)}}getDefault(e){return W.isObj(this.defaults_)&&this.defaults_[e]||undefined}getDefaults(){return W.isObj(this.defaults_)&&W.assign({},this.defaults_)||{}}}function Xn(d){const e=d.options_.runtime_.settings;const h=e.videoCloud&&e.videoCloud.bumper;let f=false;let p;return{setSource(e,t){const s=d.usingPlugin("playlist")&&d.playlist().length>0;const n=(s&&d.playlist.currentItem()>-1?d.playlist()[d.playlist.currentItem()]:d.mediainfo)||{};const i=d.bcPlaylistUi&&d.bcPlaylistUi().options.autoadvance;const r=n.id;const a=n.manifestExpiresAt;d.catalog.isCurrentSourceBumper_=h&&(h.id===n.id||h.id===`ref:${n.referenceId}`);const o=()=>{const e=d.paused();d.catalog.get({id:r,type:"video"}).then(i=>{d.catalog.load(i);if(s){n.manifestExpiresAt=i.manifestExpiresAt;n.sources.forEach((e,t)=>{e.src=i.sources[t].src})}d.one("canplay",()=>{if(!e){d.play()}})}).catch(e=>{d.log.warn(e)})};if(Date.now()>a){o();return}d.one("play",()=>{if(Date.now()>a){o();return}});const l=()=>{d.one("play",()=>d.trigger("bumper-play"));d.one("ended",()=>{d.trigger("bumper-ended");f=true})};const c=()=>{d.one("bumper-ended",()=>{d.bigPlayButton.hide();d.posterImage.hide();if(p){p.poster="";d.catalog.load(p);if(i){d.playlist.autoadvance(i)}}})};if(h){if(d.catalog.isCurrentSourceBumper_);else{p=s?n:p||d.mediainfo}if(!f&&!d.catalog.isCurrentSourceBumper_){const u=s&&d.playlist.currentItem()>0?true:false;d.catalog.get({id:h.id,type:"video"}).then(e=>{e.economics="FREE";e.poster=p.poster;d.catalog.bumper_=w(h,{video:e});d.catalog.load(e)});if(u){d.one("loadedmetadata",()=>{d.play()})}}else if(!f&&d.catalog.isCurrentSourceBumper_){l();c()}else if(f&&!d.catalog.isCurrentSourceBumper_){d.one("loadedmetadata",()=>{d.play();if(s){f=false}})}}t(null,e)}}}const Kn={production:"https://edge-gsc.api.brightcove.com",staging:"https://edge-gsc.api.staging.brightcove.com",qa:"https://edge-gsc.api.qa.brightcove.com"};const Qn={maxRetry:3,intervalRetry:6e4,interval:null};const l={MAX_CONCURRENCY:"MAX_CONCURRENCY",TOKEN_REQUIRED:"TOKEN_REQUIRED",INVALID_TOKEN:"INVALID_TOKEN",ACCOUNT_ID:"ACCOUNT_ID",UID:"UID",SESSION_ID:"SESSION_ID",CLIMIT:"CLIMIT",VIDEO_ID:"VIDEO_ID",SESSION_STOPPED:"SESSION_STOPPED",SESSION_EXPIRED:"SESSION_EXPIRED",PLAYBACK_RESTRICTIONS:"PLAYBACK_RESTRICTIONS",TOKEN_VALIDATION:"TOKEN_VALIDATION",SESSION_NOT_FOUND:"SESSION_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_NOT_FOUND"};const Jn=(e,t)=>{if(!t){t="production"}return`${Kn[t]}/api/v1/accounts/${e}/sessions`};const Zn=(e,t)=>{const{statusCode:i,body:s}=e;let n=null;if(i<400||i>499){return n}const{error:r}=s;const a=r.sub_code||r.code;switch(a){case l.MAX_CONCURRENCY:n={code:"GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING"};t.log.error("GSC heartbeat max concurrency limit.",e);break;case l.TOKEN_REQUIRED:n={code:"GSC_TOKEN_REQUIRED"};t.log.error("GSC JWT is required.",e);break;case l.INVALID_TOKEN:n={code:"GSC_INVALID_TOKEN"};t.log.error("GSC JWT is required.",e);break;case l.ACCOUNT_ID:n={code:"GSC_MISSING_FIELD_ACCOUNT_ID"};t.log.error("GSC AccountID is required.",e);break;case l.UID:n={code:"GSC_MISSING_FIELD_UID"};t.log.error("GSC UID is required in JWT.",e);break;case l.SESSION_ID:n={code:"GSC_MISSING_FIELD_SESSION_ID"};t.log.error("GSC SID is required in JWT.",e);break;case l.CLIMIT:n={code:"GSC_MISSING_FIELD_CLIMIT"};t.log.error("GSC CLIMIT is required in JWT.",e);break;case l.VIDEO_ID:n={code:"GSC_MISSING_FIELD_VIDEO_ID"};t.log.error("GSC videoId is required.",e);break;case l.SESSION_STOPPED:n={code:"GSC_SESSION_STOPPED"};t.log.error("GSC session stopped.",e);break;case l.SESSION_EXPIRED:n={code:"GSC_SESSION_EXPIRED"};t.log.error("GSC session expired.",e);break;case l.PLAYBACK_RESTRICTIONS:n={code:"GSC_PLAYBACK_RESTRICTIONS"};t.log.error("GSC playback restrictions not met.",e);break;case l.SESSION_NOT_FOUND:n={code:"GSC_SESSION_NOT_FOUND"};t.log.error("GSC session not found.",e);break;case l.VIDEO_NOT_FOUND:n={code:"GSC_VIDEO_NOT_FOUND"};t.log.error("GSC video not found",e);break}return n};const er=c=>{class e{constructor(e,t={}){this.player=e;this.timerId=null;this.interval=null;this.sid=null;this.retryCount=0;this.options=c.obj.merge(Qn,t);this.shouldReInit=true;this.player.on("ended",()=>this.stop());this.player.on("dispose",()=>this.stop(null,true));this.player.on("play",()=>{if(this.shouldReInit){return this.init()}})}init(){this.onTimerTick()}onTimerTick(){this.send(e=>{const{statusCode:t,body:i}=e;if(t>=500){this.player.log.error("GSC Heartbeat failed to contact server");this.retry();return}if(t===204){this.player.log.warn("Stream Concurrency feature has not been enabled for this account");return}const s=Zn(e,c);if(s){return this.terminatePlayback(s)}this.interval=i.heartbeat_interval;if(!this.timerId){this.timerId=this.player.setInterval(()=>this.onTimerTick(),this.interval);this.retryCount=0}this.shouldReInit=false;this.sid=i.sid})}terminatePlayback(e){this.clear();this.player.one("playerreset",()=>this.player.error(e));this.player.reset()}retry(){const{maxRetry:e,intervalRetry:t}=this.options;if(this.retryCount>=e){this.terminatePlayback({code:"GSC_SESSION_STOPPED"});return}this.clear();this.retryCount++;this.player.setTimeout(()=>this.onTimerTick(),t)}send(i){const{catalog:e}=this.player;const t=e.getCatalogParamDefault_("accountId");const s=e.getCatalogParamDefault_("bcovAuthToken");const n=e.getCatalogParamDefault_("env");const r={Authorization:"Bearer "+s};const a={url:Jn(t,n),method:"POST",json:true,headers:r,body:{video:this.player.mediainfo?this.player.mediainfo.id||"":""}};c.xhr(a,(e,t)=>{if(e){c.log.error("GSC Heartbeat failed to perform request.",e);this.retry();return}i(t)})}clear(){if(!this.timerId){return}this.player.clearInterval(this.timerId);this.timerId=null;this.interval=null;this.sid=null}stop(n=false,r=false){this.isCasting=n;c.log.debug("GSC: about to stop and clear heartbeat");const{catalog:e}=this.player;const t=e.getCatalogParamDefault_("accountId");const i=e.getCatalogParamDefault_("bcovAuthToken");const s=e.getCatalogParamDefault_("env");const a=Jn(t,s);const o={Authorization:"Bearer "+i};const l={url:a,method:"DELETE",json:true,headers:o};this.clear();c.xhr(l,(e,t,i)=>{if(e){c.log.error("GSC failed request for stop session.",e)}if(r){return}const s=Zn(t,c);if(s){this.player.error(s)}if(!n){this.player.one("play",()=>this.init())}})}destroy(){this.player.off("ended",()=>this.stop());this.player.off("dispose",()=>this.stop(null,true));this.player.off("play",()=>{if(this.shouldReInit){return this.init()}});this.stop(null,true)}getSessionId(){return this.sid||""}setOptions(e){this.retryCount=0;this.options=c.obj.merge(Qn,e)}}return e};const tr=/([A-Za-z0-9])_([A-Za-z0-9])/g;const ir=e=>e.replace(tr,(e,t,i)=>t+i.toUpperCase());const sr=(e,t)=>{return(e.type==="application/vnd.apple.mpegurl"||e.type==="application/dash+xml")&&t.toLowerCase()==="html5"};const nr=(e,t)=>{if(!t){return e}let i=e;if(t.preferMp4){i=e.filter(e=>e.container&&e.container.toLowerCase()==="mp4");if(Array.isArray(t.preferMp4)){const[n,r]=t.preferMp4;i=i.sort((e,t)=>{const i=e.hasOwnProperty(n)?e[n]:null;const s=t.hasOwnProperty(n)?t[n]:null;if(i===null||s===null||!W.isNum(i)||!W.isNum(s)){return 0}if(W.isNonEmptyStr(r)&&r.toLowerCase()==="asc"){return i-s}return s-i})}}else if(t.preferDash){i=e.filter(e=>e.type&&e.type.toLowerCase()==="application/dash+xml")}else if(t.preferHls){i=e.filter(e=>e.type&&e.type.toLowerCase()==="application/x-mpegurl")}return i};const rr=_=>{const v=rn(_);const b=hn(_);const T=N(_);const S=In(_);const E=er(_);const w=e=>{const t=_.obj.merge(e);Object.keys(t).filter(e=>e.match(tr)).forEach(e=>{t[ir(e)]=t[e]});return t};const I=(e,t)=>{if(!t){return}e.mediainfo=w(t);const i=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const s=e.mediainfo.name;if(i&&s){Ny.title=s}};const C=(e,t)=>{if(!t){return}e.playlistinfo=w(t);delete e.playlistinfo.videos};function e(r){const c=this;const s=e=>{if(e&&e.accountId){c.trigger({type:"usage",name:"catalog-get-account-id"});return e.accountId}if(typeof c.getAccountId==="function"){return c.getAccountId()}return r.accountId||c.options_["data-account"]};const u=new Yn;let n={};let a;const i={policyKey:c.options_["data-policy-key"],bcovAuthToken:c.options_["data-bcov-auth-token"],watermarkingToken:c.options_["data-watermarking-token"]};const t=Object.keys(i).reduce((e,t)=>{if(i[t]){e[t]=i[t]}return e},{});["adConfigId","allowPlayreadyInChromiumEdge","baseUrl","bcovAuthToken","deliveryConfigId","env","policyKey","sourceSelectionRules","watermarkingToken","tveToken"].forEach(e=>{if(r.hasOwnProperty(e)){t[e]=r[e]}});let o=null;if(r.streamConcurrency){o=new E(c,r)}u.setDefaults(t);_.hook("beforeerror",an);on(c);c.on("loadstart",()=>{if(!c.usingPlugin("playlist")||!c.playlist()||!c.playlist().length){return}I(c,c.playlist()[c.playlist.indexOf(c.currentSrc())])});c.on("dispose",()=>mn(c));const l=(e,t)=>{const i=Bn.getFairPlaySources(e);if(!i.length){t();return}Bn.resolveFairPlayCertificates(c,i,e=>{if(e){_.log("Unable to resolve FairPlay certificates",e)}t()})};const d=e=>{if(!c.hasPlugin||!c.hasPlugin("ssai")||!e){return e}return e.map(function(e){if(e.vmap){e.type=_.getPlugin("ssai").MIME_TYPE;e.originalHlsSource=e.src;e.src=e.vmap}return e})};const h=e=>{if(!e.variants){return e}const{name:t,description:i,longDescription:s,customFields:n}=e;const r=null;const a={name:t,description:i,longDescription:s,language:r};a.customFields=_.obj.merge(n);const o=e.variants.map(w);e.variants=[...o,a];return e};const f=e=>{if(!e){return}if(Array.isArray(e)){a=e.map(e=>h(w(e)))}else{a=h(w(e))}};const p=(e,t)=>{if(!e||!e.variants){return _.obj.merge(e)}let i=null;let s=null;if(typeof t==="string"){i=t.toLowerCase();s=i.split("-")[0]}const n=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===i);const r=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===s);const a=()=>e.variants.find(e=>e.language===null);const o=n()||r()||a();return _.obj.merge(e,o)};const m=a=>{const e=()=>{let t=false;I(c,a);f(a);if(Fn(c)){const e=c.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}c.el().setAttribute("data-video-id",a.id);if(Ly.bc&&!Ly.bc.disposedAfterPreroll_){c.poster(a.poster)}if(a.sources){for(let e=0;e<a.sources.length;e++){if(a.sources[e].vmap!==undefined){t=true;break}}}if(t&&c.onceux!==undefined){c.onceux.loadSourcesFromCatalog(a.sources)}else{if(t){a.sources=d(a.sources)}c.src(a.sources)}gn(c,a);if(a.textTracks){const s=new RegExp("^"+Ly.location.protocol);const n=new RegExp("^https:");let t=null;let i=null;for(let e=0;e<a.textTracks.length;e++){const r=a.textTracks[e];if(r.label==="thumbnails"){if(c.usingPlugin("thumbnails")&&r.width<=480){if(s.test(r.src)){t=r}else if(n.test(r.src)){i=r}}}else{c.addRemoteTextTrack(r)}}const e=t||i;if(e){c.addRemoteTextTrack({src:e.src,label:"thumbnails",kind:"metadata",mode:"hidden"},false)}if(a.textTracks.length>0&&_.browser.IS_ANY_SAFARI||_.browser.IS_IOS){c.crossOrigin("anonymous")}}};l(a.sources,e)};const g=i=>{if(!c.usingPlugin("playlist")){c.log.warn("A playlist was loaded from the Playback API, but this player is not using the playlist plugin. The first video in the playlist will be loaded instead!");m(i[0]);return}const e=()=>{c.on("beforeplaylistitem",(e,t)=>gn(c,t));c.on("playlistchange",()=>f(c.playlist()));for(let e=0;e<i.length;e++){i[e].sources=d(i[e].sources);const t=i[e].textTracks;if(t&&t.length>0){i[e].textTracks=t.filter(e=>e.label!=="thumbnails")}}const e=i.startingIndex||0;f(i);I(c,i[e]);C(c,c.catalog.data);if(Fn(c)){const e=c.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}c.playlist(i,e)};const t=i.filter(e=>e.sources).reduce((e,t)=>e.concat(t.sources),[]);l(t,e)};const y=(e,t={})=>{let i;const s=w(e);if(s.sources){s.rawSources_=s.sources;s.sources=(r.getSources||T)(c,s,t);if(t.sourceSelectionRules){s.sources=nr(s.sources,t.sourceSelectionRules)}i=c.selectSource(s.sources)}if(s.posterSources){s.poster=_n(s.posterSources)}if(s.thumbnailSources){s.thumbnail=_n(s.thumbnailSources)}if(s.textTracks){const n=i&&sr(i.source,i.tech);s.textTracks=s.textTracks.filter(e=>{return!(n&&e.in_band_metadata_track_dispatch_type!==undefined)}).map(e=>{if(e.sources){e.src=_n(e.sources)}return e})}if(s.duration){s.duration=s.duration*.001}if(s.cuePoints){for(let e=0;e<s.cuePoints.length;e++){pn(s,e)}}if(s.manifestUrlTtl){s.manifestExpiresAt=Date.now()+s.manifestUrlTtl*1e3}return s};c.catalog={transformCatalogError:un,transformVideoResponse:y,mediaCuePointsTrack(){if(!c.catalog.mediaCuePointsTrack.hasWarned_){_.log.warn("player.catalog.mediaCuePointsTrack() is deprecated, please use player.mediaCuePointsTrack() instead!");c.catalog.mediaCuePointsTrack.hasWarned_=true}return c.mediaCuePointsTrack()},get(a,t){a=u.normalize(a);if(c.catalog.tveToken){a.tveToken=c.catalog.tveToken}n=a;c.catalog.loading++;let e;const i=new Promise((n,r)=>{e=S(c,s(a),a,(e,t)=>{c.catalog.loading--;if(a.type===L&&t&&(!t.videos||!t.videos.length)){e=new Error("No videos returned from search")}if(e){e.data=t;c.catalog.error=e;return r(e)}if(!t){return n(null)}c.catalog.data=_.obj.merge({},t);if(a.adConfigId){c.catalog.data.adConfigId=a.adConfigId}const i=["allowPlayreadyInChromiumEdge","bcovAuthToken","policyKey","sourceSelectionRules"].reduce((e,t)=>{if(a.hasOwnProperty(t)){e[t]=a[t]}return e},{});if(a.watermarkingToken){i.watermarkingToken=a.watermarkingToken}if(a.tveToken){i.tveToken=a.tveToken}if(a.type===Zs){c.catalog.sources=t.sources;c.catalog.poster=t.poster;return n(y(t,i))}const s=t.videos.filter(e=>!e.hasOwnProperty("errors")).map(e=>y(e,i));if(s.length){return n(s)}return r(new Error("No videos returned from playlist"))})});if(!W.isFn(t)){return i}i.then(e=>{t(null,e)}).catch(e=>{t(e,e.data)});return e},getVideo(e,t=()=>{},i){return this.get(u.normalize(e,Zs,i),t)},getSequence(r,a=()=>{},e){if(!Array.isArray(r)){r=[r]}if(!c.usingPlugin("playlist")){throw new Error("getSequence requires the playlist plugin")}r=r.filter(e=>{if(!/^(search|video|playlist)$/i.test(e.type)){_.log.error("invalid sequence type, please use search, video, or playlist. for:",e);return false}return true});if(!r.length){a(new Error("No valid sequences"),null);return}let o=r.length;const l=new Array(r.length);return r.map((s,n)=>{return this.get(u.normalize(s,s.type,e),(e,t)=>{o--;if(e){_.log.error("failed to request sequence",s);_.log.error("with error",e)}else if(t){if(!Array.isArray(t)){t=[t]}l[n]=t}if(o===0){c.catalog.data=l;const i=l.reduce((e,t)=>t&&e.concat(t),[]);if(!i.length){a(new Error("No data was loaded for the sequence "+JSON.stringify(r),null))}else{a(null,i)}}},e)})},getLazySequence(s,e=()=>{},t){if(!Array.isArray(s)){s=[s]}if(!c.usingPlugin("playlist")){throw new Error("getLazySequence requires the playlist plugin")}const n=i=>{return this.getSequence(s.shift(),(e,t)=>{if((e||!t)&&s&&s.length){return n(i)}i(e,t)},t)};const r=()=>{if(!s.length){c.off("playlistitem",r);return}const e=c.playlist;const i=e.currentIndex&&e.currentIndex()||e.currentItem&&e.currentItem()||0;const t=e.lastIndex&&e.lastIndex()||e().length-1||0;if(i!==t){return}n((e,t)=>{if(e||!t){return}c.playlist(c.playlist().concat(t),i)})};c.on("playlistitem",r);return n(e)},getSearch(e,t=()=>{},i){return this.get(u.normalize(e,L,i),t)},getPlaylist(e,t=()=>{},i){return this.get(u.normalize(e,A,i),t)},load(e){if(Array.isArray(e)){g(e)}else{m(e)}},autoFindAndLoadMedia(e){const t=v(e,c);if(!t){return}e.playlistVideoId=t.playlistVideoId;const i=b(t.type,c,e);if(t.type===en){this.getLazySequence(t.id,i)}else{this.get(u.normalize(t),i)}return t},setBcovAuthToken(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("Authorization Token must be a valid string or null");return}u.setDefaults({bcovAuthToken:e})},setPolicyKey(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("Policy key must be a valid string or null");return}u.setDefaults({policyKey:e})},setAdConfigId(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("Ad Config ID must be a valid string or null");return}u.setDefaults({adConfigId:e})},setDeliveryConfigId(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("Ad Config ID must be a valid string or null");return}u.setDefaults({deliveryConfigId:e})},setBaseUrl(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("Catalog API base URL must be a valid string or null");return}u.setDefaults({baseUrl:e})},setWatermarkingToken(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("Watermarking token must be a valid string or null");return}u.setDefaults({watermarkingToken:e})},setTVEToken(e){if(e!==null&&!W.isNonEmptyStr(e)){_.log.warn("TVE token must be a valid string or null");return}u.setDefaults({tveToken:e})},updateGSC(e){if(e.streamConcurrency){if(o){o.setOptions(e)}else{o=new E(c,e);if(c.currentTime()>0){o.init()}}}else if(o){o.destroy();o=null}},getWatermarkingToken(){return u.getDefault("watermarkingToken")},getTVEToken(){return u.getDefault("tveToken")},getCatalogParamDefault_(e){if(e==="accountId"){return s()}return u.getDefault(e)},getLastParams(){return _.obj.merge(n)},getLastData(){return _.obj.merge(c.catalog.data)},getMetadata(e){const{type:t,lang:i}=e?e:{};if(!a){_.log.debug("getMetadata() called with no cached metadata");return t===A?[]:{}}const s=c.usingPlugin("playlist")?c.playlist():[];if(t===A&&s.length){return a.map(e=>p(e,i))}if(s.length&&Array.isArray(a)){const n=c.playlist.indexOf(c.currentSrc());if(n===-1){return{}}return p(a[n],i)}return p(a,i)},getHeartbeat(){return o},bumper(){return this.bumper_||null},isCurrentSourceBumper(){return this.isCurrentSourceBumper_},loading:0}}if(!_.getPlugin("catalog")){_.use("*",Xn);_.registerPlugin("catalog",e);e.VERSION=D}};const ar={activeCues:null,cues:null,id:"",inBandMetadataTrackDispatchType:undefined,kind:"metadata",label:"",language:"",mode:"",oncuechange:undefined};const or=["activeCues","cues","id","inBandMetadataTrackDispatchType","kind","label","language"];const lr=["mode"];const cr=function(e,t){if(e==="media"&&t.kind==="metadata"&&t.label==="media-cues"){return true}if(e==="id3"&&typeof t.inBandMetadataTrackDispatchType==="string"&&t.inBandMetadataTrackDispatchType.trim().length>0){return true}return false};const ur=e=>{class t extends e.EventTarget{constructor(e,t,i=()=>{}){super();const s=this;s.player_=e;s.reTriggerEvent_=s.reTriggerEvent_.bind(s);s.update_=s.update_.bind(s);s.type_=t;s.logger_=i;or.concat(lr).forEach(t=>{const e={get:()=>s.track_&&s.track_[t]||ar[t],enumerable:true};if(lr.indexOf(t)!==-1){e.set=function(e){if(!s.track_){return}s.track_[t]=e}}Object.defineProperty(s,t,e)});s.update_();const n=e.textTracks();const r=e=>{if(!s.track_){s.update_(e)}else if(s.track_.mode!=="hidden"){s.track_.mode="hidden";s.logger_(`timeupdate -> type:${s.type_}${s.track_?`,mode:${s.track_.mode}`:""} -> track was set to hidden`)}};["addtrack","removetrack"].forEach(e=>n.addEventListener(e,s.update_));s.player_.on("timeupdate",r);return s}addCue(){const e=arguments;if(!this.track_){this.one("trackexists",()=>this.addCue.apply(this,e));return}return this.track_.addCue.apply(this.track_,e)}removeCue(){const e=arguments;if(!this.track_){return this.one("trackexists",()=>this.removeCue.apply(this,e))}return this.track_.removeCue.apply(this.track_,e)}reTriggerEvent_(e){this.trigger(e)}update_(t={}){let i;if(t.type==="removetrack"&&t.track&&t.track===this.track_){i=null}else if(t.type==="addtrack"&&t.track&&!this.track_&&cr(this.type_,t.track)){i=t.track}else{const s=this.player_.textTracks();let e=s.length;while(e--){if(cr(this.type_,s[e])){i=s[e];break}}}const e=(...e)=>{if(t.type==="timeupdate"){return}this.logger_(...e)};e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> event:${t.type||"constructor"}`);if(this.track_===i){e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> ${i?"already proxied":"no track to proxy"}`);return}if(this.track_){this.track_.removeEventListener("cuechange",this.reTriggerEvent_)}this.track_=i;if(!this.track_){e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> track changed, but no new track exists`);return}if(this.track_.mode!=="hidden"){this.track_.mode="hidden"}this.track_.addEventListener("cuechange",this.reTriggerEvent_);this.trigger("trackexists");e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> track exists`)}}t.prototype.allowedEvents_={cuechange:"cuechange"};return t};const dr=e=>{const i=ur(e);const n={id3CuePointsTrack(e){let t=this.proxyTracks_.id3;if(!t){t=this.proxyTracks_.id3=new i(this,"id3",e)}return t},mediaCuePointsTrack(e){let t=this.proxyTracks_.media;if(t){return t}t=this.proxyTracks_.media=new i(this,"media",e);if(t.track_){return t}this.addTextTrack("metadata","media-cues");t.update_();return t}};function t(t={}){this.proxyTracks_={};let s=e.createLogger("proxyTracks");if(!t.debug){s=()=>{}}s("initialized");Object.keys(n).forEach(e=>{this[e]=()=>n[e].call(this,s)});this.ready(()=>{Object.keys(n).forEach(e=>{const i=this[e]();if(t.debug){i.on("cuechange",()=>{for(let e=0;e<i.activeCues.length;e++){const t=i.activeCues[e];s(`${i.type_} -> cuechange -> activeCues[${e}]: ${t.value&&t.value.key||t.frame&&t.frame.id}`)}})}})})}e.registerPlugin("proxyTracks",t);t.VERSION=D};const hr=function(e,t){const i=e.encryptedWatcher().encryptedSeen();if(!t||!i||t.code!==-2||e.currentTime()>.1){return t}let s;const n=e.currentSource();if(!e.hasPlugin("eme")){s="DRM/EME plugin is not included!"}else if(e.hasPlugin("eme")&&!e.usingPlugin("eme")){s="DRM/EME plugin is included but not initialized!"}else if(!n.keySystems||!Object.keys(n.keySystems).length){s="DRM (keySystems) was not provided!"}if(s){return{code:5,message:`DRM configuration issue prevented playback: ${s}`}}return t};const fr=e=>{const t=e.getPlugin("plugin");class i extends t{constructor(e,t){super(e,t);this.player_=e;this.reset();this.handleEncrypted_=this.handleEncrypted_.bind(this);this.reset=this.reset.bind(this);this.player_.ready(()=>{this.player_.tech_.on("encrypted",this.handleEncrypted_);this.player_.tech_.on("webkitneedkey",this.handleEncrypted_);this.player_.tech_.on("msneedkey",this.handleEncrypted_);this.player_.tech_.on("loadstart",this.reset)},true)}handleEncrypted_(){this.encryptedSeen_=true}encryptedSeen(){return this.encryptedSeen_}reset(){this.encryptedSeen_=false}dispose(){this.reset();this.player_.tech_.off("encrypted",this.handleEncrypted_);this.player_.tech_.off("webkitneedkey",this.handleEncrypted_);this.player_.tech_.off("msneedkey",this.handleEncrypted_);this.player_.tech_.off("loadstart",this.reset)}}const s=e.hooks("beforeerror");if(s.indexOf(hr)===-1){e.hook("beforeerror",hr)}e.registerPlugin("encryptedWatcher",i)};const pr={verbose:false,maxSavedSeekEvents:10,debounceTimeout:1e3,playbackRateTolerance:1.5,stableTimeUpdateCount:3,minInterval:1};const mr=function(e){if(e.isDisposed_){return}e.trigger("seek")};const gr=function(S){const e=function(e){const t=S.obj.merge(pr,e);let i;let s=false;let n;let r;let a;let o;let l=0;const c=[];let u=0;const d={};const h={};const f=t.verbose?(...e)=>S.log.call(S,"seek-events:",...e):()=>{};const p=function(){d.seek=this.seekEvents.last().seekEnd;s=false;f("event seekStart: ",this.seekEvents.last().seekStart);f("event seekEnd: ",this.seekEvents.last().seekEnd)};const m=function(){f("stable");this.seekEvents.stable=true};const g=function(){f("unstable");this.seekEvents.stable=false};const y=function(e){d.seek=this.currentTime();d.clock=e.timeStamp||Date.now();h.seek=d.seek;h.clock=d.clock};const _=mt(mr,t.debounceTimeout);const v=function(e){n=this.currentTime();r=e.timeStamp||+new Date;a=n-h.seek;if(r===h.clock||n===d.seek){return}o=Math.abs(a)/(Math.abs(r-h.clock)*.001);if(o/this.playbackRate()>this.seekEvents.playbackRateTolerance){if(Math.abs(n-d.seek)>=this.seekEvents.minInterval){this.trigger("unstable");l=0;if(!s){u=Number(d.seek)}c.push({timeStamp:r,seekStart:u,seekEnd:n,seekInterval:n-u});if(c.length>t.maxSavedSeekEvents){c.shift()}s=true;_(this)}}else{l++;if(l>=this.seekEvents.stableTimeUpdateCount&&!this.seekEvents.stable&&!s){this.trigger("stable")}d.seek=n}h.seek=n;h.clock=r};const b=function(){if(!i){return}i=false;this.off("seek",p);this.off("stable",m);this.off("unstable",g);this.off(["loadstart","playing","adplaying"],y);this.off(["timeupdate","adtimeupdate"],v)};const T=function(){this.seekEvents.disable();this.seekEvents=undefined};this.seekEvents={stableTimeUpdateCount:t.stableTimeUpdateCount,playbackRateTolerance:t.playbackRateTolerance,debounceTimeout:t.debounceTimeout,minInterval:t.minInterval,stable:false,enabled(){return i},enable:function(){if(i){return}i=true;d.seek=0;d.clock=Date.now();h.seek=0;h.clock=d.clock;this.on("seek",p);this.on("stable",m);this.on("unstable",g);this.on(["loadstart","playing","adplaying"],y);this.on(["timeupdate","adtimeupdate"],v);this.one("dispose",T)}.bind(this),disable:b.bind(this),last(){return c[c.length-1]},all(){return c}};this.seekEvents.enable()};e.VERSION=D;S.registerPlugin("seekEvents",e)};const yr=function(e){e.registerPlugin("touchActive",function(){if(!e.browser.TOUCH_ENABLED){return}const t=this;let i=false;const s=function(){if(!i){t.userActive(false)}};t.one("play",function(){const e=t.options_.inactivityTimeout>0?t.options_.inactivityTimeout:5e3;t.el().className+=" vjs-user-active";t.one(["click","tap"],function(){i=true});t.setTimeout(s,e)})})};const _r={"com.widevine.alpha":"Widevine","com.microsoft.playready":"PlayReady","com.apple.fps":"FairPlay"};const vr={'video/ogg; codecs="theora"':"Ogg",'video/mp4; codecs="avc1.42E01E"':"H.264",'video/mp4; codecs="hvc1"':"HEVC",'video/webm; codecs="vp8, vorbis"':"WebM",'video/webm; codecs="vp9"':"VP9",'application/x-mpegURL; codecs="avc1.42E01E"':"HLS","application/dash+xml":"DASH",'video/mp4; codecs="mp4a.40.2"':"AAC",'video/mp4; codecs="mp4a.6B"':"MP3",'video/mp4; codecs="ac-3"':"Dolby Digital/AC-3",'video/mp4; codecs="mp4a.a6"':"Dolby Digital Plus/EC-3/E-AC-3"};let br=Ny.createElement("video");const Tr={eme:Object.keys(_r).reduce((e,t)=>{e[t]={name:_r[t],persistentState:false,support:false};return e},{support:Boolean(Ly.navigator.requestMediaKeySystemAccess||Ly.MSMediaKeys&&Ly.MSMediaKeys.isTypeSupported||Ly.WebKitMediaKeys&&Ly.WebKitMediaKeys.isTypeSupported)}),formats:Object.keys(vr).reduce((e,t)=>{const i=vr[t];let s=br.canPlayType(t);if(s){s=s.charAt(0).toUpperCase()+s.slice(1)}else{s="Not supported"}e[i]=s;return e},{}),mse:"MediaSource"in Ly};br=null;if(!Ly.navigator.requestMediaKeySystemAccess){const lc=Ly.MSMediaKeys&&Ly.MSMediaKeys.isTypeSupported||Ly.WebKitMediaKeys&&Ly.WebKitMediaKeys.isTypeSupported||(()=>false);Ly.navigator.requestMediaKeySystemAccess=function(i,t){let s;let n;Ly.setTimeout(()=>{const e=t.some(e=>{let t=[];if(e.audioCapabilities){t=t.concat(e.audioCapabilities)}if(e.videoCapabilities){t=t.concat(e.videoCapabilities)}return t.some(e=>{return!lc(i,e.contentType)})});if(e){n()}else{s()}});return{then(e){s=e;return this},catch(e){n=e;return this}}}}const Sr={"com.widevine.alpha":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"',robustness:"SW_SECURE_CRYPTO"}]},"com.microsoft.playready":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]},"com.apple.fps":{initDataTypes:["sinf"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}};const Er=(s,n={})=>{Object.keys(Sr).forEach(t=>{const e=JSON.parse(JSON.stringify(Sr[t]));if(n.persistentState){e.persistentState=n.persistentState}const i=e=>{Tr.eme[t][s]=false};try{Ly.navigator.requestMediaKeySystemAccess(t,[e]).then(()=>{Tr.eme[t][s]=true}).catch(i)}catch(e){i()}})};Er("support");Er("persistentState",{persistentState:"required"});function wr(e){return e.obj.merge(Tr)}const{get:m}=W;const g="unknown";const Ir=c=>{const e=c.getComponent("ModalDialog");const{dom:u}=c;const s={adonly:"Ad-Only",ampSupport:"AMP Support",bcAa:"Adobe Analytics",bcGa:"Google Analytics",bcGtm:"Google Tag Manager",bcPlaylistUi:"Brightcove Playlist UI",bcTealium:"Tealium",chromecastReceiver:"Chromecast Receiver",customEndscreen:"Custom Endscreen",dash:"DASH",dvrux:"Live DVRUX",FreeWheelPlugin:"FreeWheel",ima3:"IMA3",kollective:"Kollective",onceux:"OnceUX",pinning:"Pinning",qualityMenu:"Quality Menu",social:"Social",ssai:"SSAI",thumbnails:"Thumbnails",vr:"VR"};const a=(e,t="vjs-two")=>{return u.createEl("table",{className:t},{},u.createEl("tbody",{},{},e))};const o=(...e)=>{const t=e.map(e=>u.createEl("td",{},{},String(e)));return u.createEl("tr",{},{},t)};class t extends e{buildCSSClass(){return`vjs-player-info-modal ${super.buildCSSClass()}`}dataForPlugins_(){return Object.keys(s).filter(c.getPlugin).sort().map(e=>{const t=this.player();let i=c.getPluginVersion(e)||m(t,`${e}.VERSION`,g);if(e==="eme"&&i===g&&c.drm&&c.drm.VERSION){i=c.drm.VERSION}return{active:t.usingPlugin(e),displayName:s[e],version:i}})}dataForSource_(){const e=this.player();const t=e.currentSource()||{};const i=e.tech(true);return{keySystem:i?i.el().keySystem:null,mediainfo:e.mediainfo,tech:e.techName_,type:t.type,url:t.src}}dataForVhs_(){const e=this.player();const t=e.tech(true);const i=t?t.vhs:null;if(!i){return null}const s={bandwidth:m(i,"stats.bandwidth",g),mediaBytesTransferred:m(i,"stats.mediaBytesTransferred",g),mediaTransferDuration:m(i,"stats.mediaTransferDuration",g),mediaRequests:m(i,"stats.mediaRequests",g),versions:i.version()};const n=m(i,"playlists",{media:()=>{}}).media();if(n){s.rendition={height:m(n,"attributes.RESOLUTION.height",g),width:m(n,"attributes.RESOLUTION.width",g)}}return s}data(){const e=this.player();const t=u.getAttributes(e.el());const i=this.player().bcAnalytics.client;const s=m(e,"bcinfo.accountId",m(t,"data-account",g));const n=m(e,"bcinfo.playerId",m(t,"data-player",g));const r=m(e,"bcinfo.embedId",m(t,"data-embed",g));const a=m(e,"bcinfo.applicationId",m(t,"data-application-id","-"));const o=m(Ly,`bc.${n}_${r}.VERSION`,m(Ly,"bc.VERSION",g));const l=m(Ly,`bc.${n}_${r}.videojs.VERSION`,m(Ly,"videojs.VERSION",g));return{capabilities:wr(c),player:{accountId:s,playerId:n,embedId:r,applicationId:a,playerVersion:o,videojsVersion:l,language:e.language(),viewerId:i.user()},plugins:this.dataForPlugins_(),source:this.dataForSource_(),vhs:this.dataForVhs_()}}contentForPlayer_(e){const{player:t}=e;const i=[o("Brightcove Player Version",t.playerVersion),o("Video.js Version",t.videojsVersion),o("Account ID",t.accountId),o("Player ID",t.playerId),o("Embed ID",t.embedId),o("Application ID",t.applicationId),o("Viewer ID",t.viewerId)];return a(i)}contentForPlugins_(e){const t=e.plugins.map(e=>{return o(e.displayName,e.version,e.active?"Yes":"No")});if(!t.length){t.push(u.createEl("tr",{innerHTML:'<td colspan="3">No plugins available.</td>'}))}const i=a(t);const s=u.createEl("thead",{innerHTML:` <tr> <th>Name</th> <th>Version</th> <th>Active?</th> </tr> `.trim()});i.insertBefore(s,i.querySelector("tbody"));return i}contentForSource_(e){const{keySystem:t,mediainfo:i,type:s}=e.source;const n=[o("Current Media Type",s),o("DRM Key System",t||"n/a")];if(i){if(i.id){n.push(o("Video ID",i.id))}if(i.name){n.push(o("Video Name",i.name))}}return a(n)}contentForVhs_(e){const{vhs:t}=e;const i=[];if(t){if(W.isObj(t.versions)){i.push(u.createEl("tr",{innerHTML:'<td colspan="2"><b>Library Versions</b></td>'}));Object.keys(t.versions).forEach(e=>{i.push(o(e,t.versions[e]))})}i.push(u.createEl("tr",{innerHTML:'<td colspan="2"><b>Statistics</b></td>'}),o("Current Bandwidth",t.bandwidth),o("Media Bytes Transferred",t.mediaBytesTransferred),o("Media Requests",t.mediaRequests),o("Media Transfer Duration",t.mediaTransferDuration));if(t.rendition){i.push(o("Rendition Width",t.rendition.width),o("Rendition Height",t.rendition.height))}}else{i.push(u.createEl("tr",{innerHTML:'<td colspan="2">Using native playback engine.</td>'}))}return a(i)}contentForCapabilities_(e){const{eme:n,mse:t}=e.capabilities;const r=[o("Media Source Extensions",t?"Yes":"No"),o("Encrypted Media Extensions",n.support?"Yes":"No")];Object.keys(n).forEach(e=>{if(e==="support"){return}const{name:t,persistentState:i,support:s}=n[e];r.push(o(t,s?"Yes":"No"));if(s){r.push(o(`${t} with persistentState`,i?"Yes":"No"))}});return a(r)}contentForFormats_(e){const{formats:t}=e.capabilities;const i=Object.keys(t).map(e=>{return o(e,t[e])});return a(i)}content(){const e=this.data();return[u.createEl("div",{className:"vjs-pi-section"},{},[u.createEl("h2",{},{},"Player Information"),this.contentForPlayer_(e),u.createEl("h2",{},{},"Media Information"),this.contentForSource_(e),u.createEl("h2",{},{},"Player Plugins"),this.contentForPlugins_(e)]),u.createEl("div",{className:"vjs-pi-section"},{},[u.createEl("h2",{},{},"Playback Engine"),this.contentForVhs_(e),u.createEl("h2",{},{},"Device Capabilities"),this.contentForCapabilities_(e),u.createEl("h2",{},{},"Device Format Support"),this.contentForFormats_(e)])]}}c.registerComponent("PlayerInfoModal",t);return t};const Cr=e=>{Ir(e);function t(){if(this.playerInfo.modal){this.playerInfo.modal.dispose()}this.playerInfo=function(){t.apply(this,arguments)};this.ready(()=>{this.addClass("vjs-player-info");this.playerInfo.modal=this.addChild("playerInfoModal",{fillAlways:true,label:this.localize("Player Information Dialog"),temporary:false});this.playerInfo.modal.on("dispose",()=>{delete this.playerInfo})})}e.registerPlugin("playerInfo",t);t.VERSION=D};const kr=e=>{const s=(e,t)=>{if(typeof e.usingPlugin==="function"){return e.usingPlugin(t)}return!!e[t]};const i=e=>{e.postrollFinished=false;e.postrollTimedOut=false;e.sawNoPostrollEvent=false};const n=e=>{if(!s(e,"ads")){return false}const t=e.endscreenState_;if(t.sawNoPostrollEvent){return false}return!t.postrollFinished&&!t.postrollTimedOut};const r=e=>{if(!s(e,"playlist")){return false}const t=e.playlist;const i=t();if(t.autoadvance_.delay!==0||!i.length){return false}return t.repeat()||t.currentItem()!==i.length-1};const t=function(){if(this.endscreenState_){return}const t=this.endscreenState_={};const e=()=>{this.trigger("endscreen")};i(t);this.on("adstart",()=>{const e=this.ended();if(this.ads.adType==="postroll"){t.isPostroll=true}t.postrollFinished=!e});this.on("adend",()=>{t.postrollFinished=this.ended()});this.on("adtimeout",()=>{t.postrollTimedOut=this.ended()});this.on(["endscreen","loadstart"],()=>{this.off("adend",e);i(t)});this.on("nopostroll",()=>{t.sawNoPostrollEvent=true});this.on("ended",()=>{if(r(this)){return}if(n(this)){this.one("adend",()=>{if(t.isPostroll){e()}});return}e()})};t.VERSION=D;if(!e.getPlugin("endscreen")){e.registerPlugin("endscreen",t)}};const Ar=t=>{const e=new ArrayBuffer(t.length*2);const i=new Uint16Array(e);for(let e=0;e<t.length;e++){i[e]=t.charCodeAt(e)}return i};const Dr=e=>{return String.fromCharCode.apply(null,new Uint8Array(e.buffer||e))};const xr=e=>{return String.fromCharCode.apply(null,new Uint16Array(e.buffer||e))};const Or=e=>{const t=Ny.createElement("a");t.href=e;return t.hostname};const Pr=(e,t)=>{if(e===t){return true}if(e.byteLength!==t.byteLength){return false}const i=new DataView(e);const s=new DataView(t);for(let e=0;e<i.byteLength;e++){if(i.getUint8(e)!==s.getUint8(e)){return false}}return true};const Rr=e=>{if(e instanceof Uint8Array||e instanceof Uint16Array){return e.buffer}return e};const Lr=(...e)=>{const t=v.obj||v;const i=t.merge||t.mergeOptions;return i.apply(t,e)};const Nr=(...e)=>{const t=Lr(...e);Object.keys(t).forEach(e=>{if(t[e]===null){delete t[e]}});return t};const Mr=i=>{const s=[];Object.keys(i).forEach(e=>{const t=Wr(e,i[e])[0];s.push(t)});return s};let Ur=v.xhr.httpHandler;if(!Ur){Ur=(s,n)=>(e,t,i)=>{if(e){s(e);return}if(t.statusCode>=400&&t.statusCode<=599){let e=i;if(n){e=String.fromCharCode.apply(null,new Uint8Array(i))}s({cause:e});return}s(null,i)}}const Br=e=>{const t=String.fromCharCode.apply(null,new Uint16Array(e));const i=(new Ly.DOMParser).parseFromString(t,"application/xml");const s=i.getElementsByTagName("HttpHeaders")[0];let n={};if(s){const o=s.getElementsByTagName("name");const l=s.getElementsByTagName("value");for(let e=0;e<o.length;e++){n[o[e].childNodes[0].nodeValue]=l[e].childNodes[0].nodeValue}}const r=i.getElementsByTagName("Challenge")[0];let a;if(r){a=Ly.atob(r.childNodes[0].nodeValue)}if(i.querySelector("parsererror")){n={"Content-Type":"text/xml; charset=utf-8",SOAPAction:'"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense"'};a=e}return{headers:n,message:a}};const Fr=(e,t,i,s,n)=>{const r=Br(i);const a=r.message;const o=Nr(r.headers,s.emeHeaders,t.licenseHeaders);v.xhr({uri:t.url,method:"post",headers:o,body:a,responseType:"arraybuffer",requestType:"license",metadata:{keySystem:e}},Ur(n,true))};const b={EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video",EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session",EMEFailedToRemoveKeysFromSession:"eme-failed-remove-keys",EMEFailedToLoadSessionBySessionId:"eme-failed-load-session"};const y="com.apple.fps.1_0";const qr=({initData:e,id:t,cert:i})=>{if(typeof t==="string"){t=Ar(t)}let s=0;const n=new ArrayBuffer(e.byteLength+4+t.byteLength+4+i.byteLength);const r=new DataView(n);const a=new Uint8Array(n,s,e.byteLength);a.set(e);s+=e.byteLength;r.setUint32(s,t.byteLength,true);s+=4;const o=new Uint16Array(n,s,t.length);o.set(t);s+=o.byteLength;r.setUint32(s,i.byteLength,true);s+=4;const l=new Uint8Array(n,s,i.byteLength);l.set(i);return new Uint8Array(n,0,n.byteLength)};const jr=({video:n,contentId:r,initData:a,cert:o,options:l,getLicense:c,eventBus:u,emeError:d})=>{return new Promise((e,i)=>{if(!n.webkitKeys){try{n.webkitSetMediaKeys(new Ly.WebKitMediaKeys(y))}catch(e){const t={errorType:b.EMEFailedToCreateMediaKeys,keySystem:y};d(e,t);i("Could not create MediaKeys");return}}let s;try{s=n.webkitKeys.createSession("video/mp4",qr({id:r,initData:a,cert:o}))}catch(e){const t={errorType:b.EMEFailedToCreateMediaKeySession,keySystem:y};d(e,t);i("Could not create key session");return}T(u,{type:"keysessioncreated",keySession:s});s.contentId=r;s.addEventListener("webkitkeymessage",e=>{T(u,{type:"keymessage",messageEvent:e});c(l,r,e.message,(t,e)=>{if(u){T(u,{type:"licenserequestattempted"})}if(t){const e={errortype:b.EMEFailedToGenerateLicenseRequest,keySystem:y};d(t,e);i(t);return}s.update(new Uint8Array(e));T(u,{type:"keysessionupdated",keySession:s})})});s.addEventListener("webkitkeyadded",()=>{e()});s.addEventListener("webkitkeyerror",()=>{const e=s.error;const t={errorType:b.EMEFailedToUpdateSessionWithReceivedLicenseKeys,keySystem:y};d(e,t);i(`KeySession error: code ${e.code}, systemCode ${e.systemCode}`)})})};const Vr=(s,n)=>{return(e,i)=>{const t=Nr(e.emeHeaders,n.certificateHeaders);v.xhr({uri:n.certificateUri,responseType:"arraybuffer",requestType:"license",metadata:{keySystem:s},headers:t},Ur((e,t)=>{if(e){i(e);return}i(null,new Uint8Array(t))}))}};const $r=(e,t)=>{return Or(t)};const Hr=(r,a)=>{return(e,t,i,s)=>{const n=Nr({"Content-type":"application/octet-stream"},e.emeHeaders,a.licenseHeaders);v.xhr({uri:a.licenseUri||a.url,method:"POST",responseType:"arraybuffer",requestType:"license",metadata:{keySystem:r,contentId:t},body:i,headers:n},Ur(s,true))}};const Gr=({video:t,initData:i,options:r,eventBus:s,emeError:a})=>{const e=r.keySystems[y];const o=e.getCertificate||Vr(y,e);const n=e.getContentId||$r;const l=e.getLicense||Hr(y,e);return new Promise((s,n)=>{o(r,(e,t)=>{if(e){const i={errorType:b.EMEFailedToSetServerCertificate,keySystem:y};a(e,i);n(e);return}s(t)})}).then(e=>{return jr({video:t,cert:e,initData:i,getLicense:l,options:r,contentId:n(r,xr(i)),eventBus:s,emeError:a})})};const zr=e=>e.startsWith("com.apple.fps");const T=(e,t)=>{if(e.isDisposed()){return}e.trigger(w({},t))};const Wr=(e,t)=>{if(t.supportedConfigurations){return t.supportedConfigurations}const i=zr(e);const s={};const n=t.initDataTypes||(i?["sinf"]:null);const r=t.audioContentType;const a=t.audioRobustness;const o=t.videoContentType||(i?"video/mp4":null);const l=t.videoRobustness;const c=t.persistentState;if(r||a){s.audioCapabilities=[w({},r?{contentType:r}:{},a?{robustness:a}:{})]}if(o||l){s.videoCapabilities=[w({},o?{contentType:o}:{},l?{robustness:l}:{})]}if(c){s.persistentState=c}if(n){s.initDataTypes=n}return[s]};const Yr=e=>{let s;Object.keys(e).forEach(t=>{const i=Wr(t,e[t]);if(!s){s=Ly.navigator.requestMediaKeySystemAccess(t,i)}else{s=s.catch(e=>Ly.navigator.requestMediaKeySystemAccess(t,i))}});return s};const Xr=(c,e)=>{const{mediaKeys:t,initDataType:i,initData:s,options:u,getLicense:d,removeSession:n,eventBus:h,contentId:f,emeError:p,keySystem:m}=e;let g=0;let r;c.on("pause",()=>{if(u.limitRenewalsMaxPauseDuration&&typeof u.limitRenewalsMaxPauseDuration==="number"){r=setInterval(()=>{g++;if(g>=u.limitRenewalsMaxPauseDuration){clearInterval(r)}},1e3);c.on("play",()=>{clearInterval(r);g=0})}});try{const y=t.createSession();const _=()=>{v.log.debug("Session expired, closing the session.");y.close().then(()=>{if(h.isDisposed()){return}T(h,{type:"keysessionclosed",keySession:y});n(s)}).catch(e=>{const t={errorType:b.EMEFailedToCloseSession,keySystem:m};p(e,t)})};T(h,{type:"keysessioncreated",keySession:y});c.on("dispose",()=>{_()});return new Promise((o,l)=>{y.addEventListener("message",e=>{T(h,{type:"keymessage",messageEvent:e});if(e.messageType!=="license-request"&&e.messageType!=="license-renewal"){return}if(e.messageType==="license-renewal"){const t=u.limitRenewalsBeforePlay;const i=u.limitRenewalsMaxPauseDuration;const s=typeof i==="number";const n=!c.hasStarted()&&t;const r=c.paused()&&s&&g>=i;const a=c.ended();if(n||r||a){_();return}}d(u,e.message,f).then(e=>{o(y.update(e).then(()=>{T(h,{type:"keysessionupdated",keySession:y})}).catch(e=>{const t={errorType:b.EMEFailedToUpdateSessionWithReceivedLicenseKeys,keySystem:m};p(e,t)}))}).catch(e=>{l(e)})},false);const e="keystatuseschange";y.addEventListener(e,s=>{let n=false;if(h.isDisposed()){return}T(h,{type:e,keyStatuses:y.keyStatuses});y.keyStatuses.forEach((e,t)=>{T(h,{keyId:t,status:e,target:y,type:"keystatuschange"});switch(e){case"expired":n=true;break;case"internal-error":const i='Key status reported as "internal-error." Leaving the session open since we '+"don't have enough details to know if this error is fatal.";v.log.warn(i,s);break}});if(n){_()}},false);y.generateRequest(i,s).catch(e=>{const t={errorType:b.EMEFailedToGenerateLicenseRequest,keySystem:m};p(e,t);l("Unable to create or initialize key session")})})}catch(e){const a={errorType:b.EMEFailedToCreateMediaKeySession,keySystem:m};p(e,a)}};const Kr=({player:e,video:t,initDataType:i,initData:s,options:n,getLicense:r,contentId:a,removeSession:o,eventBus:l,emeError:c})=>{const u={initDataType:i,initData:s,options:n,getLicense:r,removeSession:o,eventBus:l,contentId:a,emeError:c,keySystem:t.keySystem};if(t.mediaKeysObject){u.mediaKeys=t.mediaKeysObject;return Xr(e,u)}t.pendingSessionData.push(u);return Promise.resolve()};const Qr=({player:t,video:i,certificate:e,createdMediaKeys:s,emeError:n})=>{i.mediaKeysObject=s;const r=[];if(e){r.push(s.setServerCertificate(e).catch(e=>{const t={errorType:b.EMEFailedToSetServerCertificate,keySystem:i.keySystem};n(e,t)}))}for(let e=0;e<i.pendingSessionData.length;e++){const a=i.pendingSessionData[e];r.push(Xr(t,{mediaKeys:i.mediaKeysObject,initDataType:a.initDataType,initData:a.initData,options:a.options,getLicense:a.getLicense,removeSession:a.removeSession,eventBus:a.eventBus,contentId:a.contentId,emeError:a.emeError,keySystem:i.keySystem}))}i.pendingSessionData=[];r.push(i.setMediaKeys(s).catch(e=>{const t={errorType:b.EMEFailedToAttachMediaKeysToVideoElement,keySystem:i.keySystem};n(e,t)}));return Promise.all(r)};const Jr=(s,n)=>(e,t,i)=>{Fr(s,n,t,e,i)};const Zr=(n,r)=>(e,t,i)=>{const s=Nr({"Content-type":"application/octet-stream"},e.emeHeaders,r.licenseHeaders);v.xhr({uri:r.url,method:"POST",responseType:"arraybuffer",requestType:"license",metadata:{keySystem:n},body:t,headers:s},Ur(i,true))};const ea=(a,o,l)=>{return(t,n,r)=>{return new Promise((i,s)=>{const e=function(e,t){if(l){T(l,{type:"licenserequestattempted"})}if(e){s(e);return}i(t)};if(zr(a)){o(t,r,new Uint8Array(n),e)}else{o(t,n,e)}})}};const ta=(e,t)=>{if(typeof t==="string"){t={url:t}}if(!t.url&&t.licenseUri){t.url=t.licenseUri}if(!t.url&&!t.getLicense){throw new Error(`Missing url/licenseUri or getLicense in ${e} keySystem configuration.`)}const i=zr(e);if(i&&t.certificateUri&&!t.getCertificate){t.getCertificate=Vr(e,t)}if(i&&!t.getCertificate){throw new Error(`Missing getCertificate or certificateUri in ${e} keySystem configuration.`)}if(i&&!t.getContentId){t.getContentId=$r}if(t.url&&!t.getLicense){if(e==="com.microsoft.playready"){t.getLicense=Jr(e,t)}else if(i){t.getLicense=Hr(e,t)}else{t.getLicense=Zr(e,t)}}return t};const ia=({player:t,video:r,initDataType:i,initData:s,keySystemAccess:e,options:a,removeSession:n,eventBus:o,emeError:l})=>{let c=Promise.resolve();const u=e.keySystem;let d;try{d=ta(u,a.keySystems[u])}catch(e){return Promise.reject(e)}const h=d.getContentId?d.getContentId(a,Dr(s)):null;if(typeof r.mediaKeysObject==="undefined"){r.mediaKeysObject=null;r.pendingSessionData=[];let n;c=new Promise((i,s)=>{r.keySystem=u;if(!d.getCertificate){i(e);return}d.getCertificate(a,(e,t)=>{if(e){s(e);return}n=t;i()})}).then(()=>{return e.createMediaKeys()}).then(e=>{T(o,{type:"keysystemaccesscomplete",mediaKeys:e});return Qr({player:t,video:r,certificate:n,createdMediaKeys:e,emeError:l})}).catch(e=>{const t={errorType:b.EMEFailedToCreateMediaKeys,keySystem:u};l(e,t);if(e){return Promise.reject(e)}return Promise.reject("Failed to create and initialize a MediaKeys object")})}return c.then(()=>{const e=r.keySystem?ea(u,d.getLicense,o):null;return Kr({player:t,video:r,initDataType:i,initData:s,options:a,getLicense:e,contentId:h,removeSession:n,eventBus:o,emeError:l})})};const _="com.microsoft.playready";const sa=(s,n,e,r,a)=>{let o=s.keySystems[_];if(typeof o.getKey==="function"){o.getKey(s,e.destinationURL,e.message.buffer,(e,t)=>{if(e){const i={errorType:b.EMEFailedToRequestMediaKeySystemAccess,config:Mr(s.keySystems)};a(e,i);T(r,{message:"Unable to get key: "+e,target:n,type:"mskeyerror"});return}n.update(t);T(r,{type:"keysessionupdated",keySession:n})});return}if(typeof o==="string"){o={url:o}}else if(typeof o==="boolean"){o={}}if(!o.url){o.url=e.destinationURL}const t=(e,t)=>{if(r){T(r,{type:"licenserequestattempted"})}if(e){const i={errorType:b.EMEFailedToGenerateLicenseRequest,keySystem:_};a(e,i);T(r,{message:"Unable to request key from url: "+o.url,target:n,type:"mskeyerror"});return}n.update(new Uint8Array(t))};if(o.getLicense){o.getLicense(s,e.message.buffer,t)}else{Fr(_,o,e.message.buffer,s,t)}};const na=(e,t,i,s,n)=>{const r=e.msKeys.createSession("video/mp4",t);if(!r){const a=new Error("Could not create key session.");const o={errorType:b.EMEFailedToCreateMediaKeySession,keySystem:_};n(a,o);throw a}T(s,{type:"keysessioncreated",keySession:r});r.addEventListener("mskeymessage",e=>{T(s,{type:"keymessage",messageEvent:e});sa(i,r,e,s,n)});r.addEventListener("mskeyerror",e=>{const t={errorType:b.EMEFailedToCreateMediaKeySession,keySystem:_};n(r.error,t);T(s,{message:"Unexpected key error from key session with "+`code: ${r.error.code} and systemCode: ${r.error.systemCode}`,target:r,type:"mskeyerror"})});r.addEventListener("mskeyadded",()=>{T(s,{target:r,type:"mskeyadded"})})};var ra=({video:e,initData:t,options:i,eventBus:s,emeError:n})=>{if(e.msKeys){delete e.msKeys}try{e.msSetMediaKeys(new Ly.MSMediaKeys(_))}catch(e){const r={errorType:b.EMEFailedToCreateMediaKeys,keySystem:_};n(e,r);throw new Error("Unable to create media keys for PlayReady key system. "+"Error: "+e.message)}na(e,t,i,s,n)};const aa=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}];const oa=[{keySystem:"com.apple.fps",supportedConfig:[{initDataTypes:["sinf"],videoCapabilities:[{contentType:"video/mp4"}]}]},{keySystem:"com.microsoft.playready.recommendation",supportedConfig:aa},{keySystem:"com.widevine.alpha",supportedConfig:aa},{keySystem:"org.w3.clearkey",supportedConfig:aa}];const la=()=>{const e=Ly.Promise;const n={fairplay:Boolean(Ly.WebKitMediaKeys),playready:false,widevine:false,clearkey:false};if(!Ly.MediaKeys||!Ly.navigator.requestMediaKeySystemAccess){return e.resolve(n)}return e.all(oa.map(({keySystem:e,supportedConfig:t})=>{return Ly.navigator.requestMediaKeySystemAccess(e,t).catch(()=>{})})).then(([e,t,i,s])=>{n.fairplay=Boolean(e);n.playready=Boolean(t);n.widevine=Boolean(i);n.clearkey=Boolean(s);return n})};var ca="5.5.1";const ua=(t,i)=>{for(let e=0;e<t.length;e++){if(!t[e].initData){continue}const s=Rr(t[e].initData);const n=Rr(i);if(Pr(s,n)){return true}}return false};const da=(t,i)=>{for(let e=0;e<t.length;e++){if(t[e].initData===i){t.splice(e,1);return}}};function ha(i,s,n,r,a,o){if(!n||!n.keySystems){return Promise.resolve()}if(n.keySystems[y]){v.log.debug("eme",`Ignoring \'encrypted\' event, using legacy fairplay keySystem ${y}`);return Promise.resolve()}let l=s.initData;return Yr(n.keySystems).then(e=>{const t=e.keySystem;if(n.keySystems[t]&&n.keySystems[t].pssh){l=n.keySystems[t].pssh}if(ua(r,l)||!l){return Promise.resolve()}r.push({initData:l});return ia({player:i,video:s.target,initDataType:s.initDataType,initData:l,keySystemAccess:e,options:n,removeSession:da.bind(null,r),eventBus:a,emeError:o})}).catch(e=>{const t={errorType:b.EMEFailedToRequestMediaKeySystemAccess,config:Mr(n.keySystems)};o(e,t)})}const fa=(e,t,i,s)=>{if(!t.keySystems||!t.keySystems[y]||!e.initData){return Promise.resolve()}return Gr({video:e.target,initData:e.initData,options:t,eventBus:i,emeError:s})};const pa=(e,t,i,s,n)=>{if(!t.keySystems||!t.keySystems[_]){return}if(i.reduce((e,t)=>e||t.playready,false)){return}let r=e.initData;if(t.keySystems[_]&&t.keySystems[_].pssh){r=t.keySystems[_].pssh}if(!r){return}i.push({playready:true,initData:r});ra({video:e.target,initData:r,options:t,eventBus:s,emeError:n})};const ma=e=>{return Lr(e.currentSource(),e.eme.options)};const ga=e=>{const t=e.src();if(t!==e.eme.activeSrc){e.eme.activeSrc=t;e.eme.sessions=[]}};const ya=s=>{return(e,t)=>{const i={code:5};if(typeof e==="string"){i.message=e}else if(e){if(e.message){i.message=e.message}if(e.cause&&(e.cause.length||e.cause.byteLength)){i.cause=e.cause}if(e.keySystem){i.keySystem=e.keySystem}i.originalError=e}if(t){i.metadata=t}s.error(i)}};const _a=(s,t)=>{if(s.$(".vjs-tech").tagName.toLowerCase()!=="video"){return}ga(s);if(Ly.MediaKeys){const n=()=>{const e={initDataType:"cenc",initData:null,target:s.tech_.el_};ga(s);ha(s,e,ma(s),s.eme.sessions,s.tech_,t)};if(v.browser.IS_FIREFOX){let i;s.on("ended",()=>{i=false;s.one(["seek","play"],e=>{if(!i&&s.eme.sessions.length===0){n();i=true}})});s.on("play",()=>{const e=s.eme.options;const t=e.limitRenewalsMaxPauseDuration;if(s.eme.sessions.length===0&&typeof t==="number"){i=true;n()}})}s.tech_.el_.addEventListener("encrypted",e=>{v.log.debug("eme","Received an 'encrypted' event");ga(s);ha(s,e,ma(s),s.eme.sessions,s.tech_,t)})}else if(Ly.WebKitMediaKeys){s.eme.initLegacyFairplay()}else if(Ly.MSMediaKeys){s.tech_.el_.addEventListener("msneedkey",e=>{v.log.debug("eme","Received an 'msneedkey' event");ga(s);try{pa(e,ma(s),s.eme.sessions,s.tech_,t)}catch(e){t(e)}});const e=e=>{t(e)};s.tech_.on("mskeyerror",e);s.on("dispose",()=>{s.tech_.off("mskeyerror",e)})}};const va=function(a={}){const o=this;const l=ya(o);o.ready(()=>_a(o,l));o.eme={setupEmeListeners(){_a(o,l)},initializeMediaKeys(e={},t=function(){},i=false){const s=Lr(o.currentSource(),a,e);const n={initDataType:"cenc",initData:null,target:o.tech_.el_};ga(o);if(Ly.MediaKeys){ha(o,n,s,o.eme.sessions,o.tech_,l).then(()=>t()).catch(e=>{t(e);if(!i){l(e)}})}else if(Ly.MSMediaKeys){const r=e=>{o.tech_.off("mskeyadded",r);o.tech_.off("mskeyerror",r);if(e.type==="mskeyerror"){t(e.target.error);if(!i){l(e.message)}}else{t()}};o.tech_.one("mskeyadded",r);o.tech_.one("mskeyerror",r);try{pa(n,s,o.eme.sessions,o.tech_,l)}catch(e){o.tech_.off("mskeyadded",r);o.tech_.off("mskeyerror",r);t(e);if(!i){l(e)}}}},initLegacyFairplay(){const s=e=>{v.log.debug("eme","Received a 'webkitneedkey' event");ga(o);fa(e,ma(o),o.tech_,l).catch(e=>{l(e)})};const e=e=>{const t=ma(o).firstWebkitneedkeyTimeout||1e3;const i=o.src();o.eme.webkitneedkey_=o.eme.webkitneedkey_||{};if(o.eme.webkitneedkey_.src!==i){o.eme.webkitneedkey_={handledFirstEvent:false,src:i}}if(!o.eme.webkitneedkey_.handledFirstEvent){o.clearTimeout(o.eme.webkitneedkey_.timeout);o.eme.webkitneedkey_.timeout=o.setTimeout(()=>{o.eme.webkitneedkey_.handledFirstEvent=true;o.eme.webkitneedkey_.timeout=null;s(e)},t)}else{s(e)}};let t=o.tech_.el_;t.addEventListener("webkitneedkey",e);const i=()=>{o.off("dispose",i);if(t!==null){t.removeEventListener("webkitneedkey",e)}t=null};o.on("dispose",i);return i},detectSupportedCDMs:la,options:a}};v.registerPlugin("eme",va);va.Error=b;va.VERSION=ca;const ba=e=>{const t=Ly.atob(e);const i=new Uint8Array(t.length);for(let e=0;e<t.length;e++){i[e]=t.charCodeAt(e)}return i};const Ta=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="";let s;let n;let r;let a;let o;let l;let c;let u=0;while(u<e.length){s=e[u++];n=u<e.length?e[u++]:Number.NaN;r=u<e.length?e[u++]:Number.NaN;a=s>>2;o=(s&3)<<4|n>>4;l=(n&15)<<2|r>>6;c=r&63;if(isNaN(n)){l=c=64}else if(isNaN(r)){c=64}i+=t.charAt(a)+t.charAt(o)+t.charAt(l)+t.charAt(c)}return i};const Sa=u=>(e,t,i)=>{if(e){return u(e)}const s=new Ly.DOMParser;const n=s.parseFromString(i,"text/xml");if(t.statusCode>=400){const l=n.getElementsByTagName("Error");let e=`License call failed with status code ${t.statusCode}.`;if(l.length>0){const c=n.getElementsByTagName("Message");if(c.length>0){e+=" "+c[0].childNodes[0].nodeValue}}return u(e)}let r="";const a=n.getElementsByTagName("ckc");if(a.length>0){r=a[0].childNodes[0].nodeValue}const o=ba(r);u(null,o)};const Ea=o=>{return{"com.apple.fps.1_0":{overrideOptions:{getLicense:(e,t,i,s)=>{const n=e.keySystems["com.apple.fps.1_0"].licenseUri;const r=Ly.btoa(String.fromCharCode.apply(null,i));const a=Sa(s);o.xhr({uri:n,method:"POST",body:`spc=${r}`,headers:{"Content-type":"application/x-www-form-urlencoded"}},a)}}}}};const wa="utf-16";const Ia="utf-8";const Ca="http://schemas.xmlsoap.org/soap/envelope/";function ka(e,t){const i=t===wa?new Uint16Array(e):new Uint8Array(e);const s=String.fromCharCode.apply(null,i);const n=new Ly.DOMParser;const r=n.parseFromString(s,"application/xml");return r}function Aa(e,t=Ia){const i=ka(e,t);let s="";let n="";let r="";let a=-1;let o=-1;const l=i?i.getElementsByTagNameNS(Ca,"Envelope")[0]:null;const c=l?l.getElementsByTagNameNS(Ca,"Body")[0]:null;const u=c?c.getElementsByTagNameNS(Ca,"Fault")[0]:null;const d=u?u.getElementsByTagName("detail")[0]:null;const h=d?d.getElementsByTagName("Exception")[0]:null;let f=null;if(!u){return null}f=u.getElementsByTagName("faultstring")[0].firstChild;s=f?f.nodeValue:null;if(h!==null){f=h.getElementsByTagName("StatusCode")[0];n=f?f.firstChild.nodeValue:null;f=h.getElementsByTagName("Message")[0];r=f?f.firstChild.nodeValue:null;a=r?r.lastIndexOf("[")+1:-1;o=r?r.indexOf("]"):-1;r=r?r.substring(a,o):""}let p=`code: ${n}, name: ${s}`;if(r){p+=`, message: ${r}`}return p}function Da(e,t=wa){const i=ka(e,t);const s={"Content-Type":`text/xml; charset=${t}`};let n=e;const r=i.querySelector("PlayReadyKeyMessage");if(!r){return{headers:s,body:n}}const a=r.querySelectorAll("name");const o=r.querySelectorAll("value");for(let e=0;e<a.length;e++){s[a[e].firstChild.textContent]=o[e].firstChild.textContent}if(s.hasOwnProperty("Content")){s["Content-Type"]=s.Content;delete s.Content}const l=r.querySelector("Challenge").firstChild.nodeValue;if(l){n=Ly.atob(l)}return{headers:s,body:n}}const xa="https://lic.drmtoday.com";const Oa=`${xa}/license-proxy-widevine/cenc/`;const Pa=`${xa}/license-proxy-headerauth/drmtoday/RightsManager.asmx`;const Ra=`${xa}/license-server-fairplay/`;const La=`${xa}/license-server-fairplay/cert/`;const Na=e=>String.fromCharCode.apply(null,new Uint16Array(e));const Ma=s=>(e,t,i)=>{if(e){return s(e)}return s(null,new Uint8Array(i))};const Ua=(e,t)=>{const i=t.buffer?t.buffer:t;const s=Na(i);const n="skd://drmtoday?";const r=s.indexOf(n);if(r>-1){return s.substring(r+n.length).replace(/assetid/gi,"assetId").replace(/variantid/gi,"variantId")}return""};const Ba=e=>e.customDataIsB64?e.customData:Ly.btoa(e.customData);const Fa=(e,n)=>e.xhr.httpHandler((e,t)=>{if(e){return n(e)}let i=t.trim();if(i.substr(0,5)==="<ckc>"&&i.substr(-6)==="</ckc>"){i=i.slice(5,-6)}const s=ba(i);n(null,s)});const qa=l=>{return{"com.apple.fps.1_0":{overrideOptions:{getCertificate:(e,t)=>{const i=Ma(t);const s=e.keySystems["com.apple.fps.1_0"];const{options:n}=s.vendor;l.xhr({uri:s.certificateUri||La,method:"GET",responseType:"arraybuffer",headers:{"x-dt-auth-token":n.authToken,"x-dt-custom-data":Ba(n),Pragma:"Cache-Control: no-cache","Cache-Control":"max-age=0"}},l.xhr.httpHandler(i))},getContentId:Ua,getLicense:(e,t,i,s)=>{const n=Fa(l,s);const r=encodeURIComponent(Ta(i));const a=e.keySystems["com.apple.fps.1_0"];const{options:o}=a.vendor;l.xhr({uri:a.licenseUri||Ra,method:"POST",responseType:"text",body:`spc=${r}&${t}`,headers:{"x-dt-auth-token":o.authToken,"x-dt-custom-data":Ba(o),"Content-type":"application/x-www-form-urlencoded"}},n)}}},"com.widevine.alpha":{overrideOptions:{getLicense(e,t,n){const i=e.keySystems["com.widevine.alpha"];const{options:s}=i.vendor;l.xhr({uri:i.licenseUri||Oa,method:"POST",responseType:"json",body:new Uint8Array(t),headers:{"x-dt-auth-token":s.authToken,"x-dt-custom-data":Ba(s)}},l.xhr.httpHandler((e,t,i)=>{if(e){n(e);return}const s=ba(i.license);n(null,s)}))}}},"com.microsoft.playready":{overrideOptions:{getLicense(e,t,s){const i=e.keySystems["com.microsoft.playready"];const{options:n}=i.vendor;const r=Da(t);r.headers["x-dt-auth-token"]=n.authToken;r.headers["x-dt-custom-data"]=Ba(n);l.xhr({uri:i.licenseUri||Pa,method:"POST",body:r.body,headers:r.headers,responseType:"arraybuffer"},l.xhr.httpHandler((e,t,i)=>{e=e||Aa(i);if(e){s(e);return}s(null,i)}))}}}}};const ja=e=>{return{azure:Ea(e),castlabs:qa(e)}};const Va=(e,t,i)=>{const s=ja(e);if(s[t]){const n=s[t][i];if(n){return n}}return null};const $a=(e,t,i,s)=>{const{getLicense:n,getContentId:r,getCertificate:a}=Va(e,i,s).overrideOptions;if(!t.getLicense&&n){t.getLicense=n}if(!t.getContentId&&r){t.getContentId=r}if(!t.getCertificate&&a){t.getCertificate=a}return t};const Ha=s=>{const e=function(i){const e=Object.keys(i);e.forEach(function(e){const t=i[e];if(t.vendor&&Va(s,t.vendor.name,e)){i[e]=$a(s,i[e],t.vendor.name,e)}});return i};return e};const Ga="CsECCAMSEBcFuRfMEgSGiwYzOi93KowYgrSCkgUijgIwggEKAoIBAQCZ7Vs7Mn2rXiTvw7YqlbWYUgrVvMs3UD4GRbgU2Ha430BRBEGtjOOtsRu4jE5yWl5KngeVKR1YWEAjp+GvDjipEnk5MAhhC28VjIeMfiG/+/7qd+EBnh5XgeikX0YmPRTmDoBYqGB63OBPrIRXsTeo1nzN6zNwXZg6IftO7L1KEMpHSQykfqpdQ4IY3brxyt4zkvE9b/tkQv0x4b9AsMYE0cS6TJUgpL+X7r1gkpr87vVbuvVk4tDnbNfFXHOggrmWEguDWe3OJHBwgmgNb2fG2CxKxfMTRJCnTuw3r0svAQxZ6ChD4lgvC2ufXbD8Xm7fZPvTCLRxG88SUAGcn1oJAgMBAAE6FGxpY2Vuc2Uud2lkZXZpbmUuY29tEoADrjRzFLWoNSl/JxOI+3u4y1J30kmCPN3R2jC5MzlRHrPMveoEuUS5J8EhNG79verJ1BORfm7BdqEEOEYKUDvBlSubpOTOD8S/wgqYCKqvS/zRnB3PzfV0zKwo0bQQQWz53ogEMBy9szTK/NDUCXhCOmQuVGE98K/PlspKkknYVeQrOnA+8XZ/apvTbWv4K+drvwy6T95Z0qvMdv62Qke4XEMfvKUiZrYZ/DaXlUP8qcu9u/r6DhpV51Wjx7zmVflkb1gquc9wqgi5efhn9joLK3/bNixbxOzVVdhbyqnFk8ODyFfUnaq3fkC3hR3f0kmYgI41sljnXXjqwMoW9wRzBMINk+3k6P8cbxfmJD4/Paj8FwmHDsRfuoI6Jj8M76H3CTsZCZKDJjM3BQQ6Kb2m+bQ0LMjfVDyxoRgvfF//M/EEkPrKWyU2C3YBXpxaBquO4C8A0ujVmGEEqsxN1HX9lu6c5OMm8huDxwWFd7OHMs3avGpr7RP7DUnTikXrh6X0";const za=ba(Ga);const Wa=Ny.createElement("video");const Ya=Ly.navigator.requestMediaKeySystemAccess||Wa.msSetMediaKeys;const Xa=e=>{return/manifest.prod.boltdns.net\/license/i.test(e)||/wvlic.brightcove.com\/proxy/i.test(e)};const Ka=i=>{i=Object.keys(i).reduce(function(e,t){e[t]={url:i[t].license_url};return e},{});const e=i["com.widevine.alpha"];if(e&&Xa(e.url)){e.getCertificate=(e,t)=>{t(null,za)}}return i};const Qa=e=>{return e.reduce((e,t)=>{e[t.name]=t.options;const i=e[t.name].serverCertificate;if(i){e[t.name].getCertificate=(e,t)=>{t(null,ba(i))};delete e[t.name].serverCertificate}return e},{})};const Ja=s=>{const e=function(e){let t=e;const i=!Ly.shaka&&e.key_systems&&Ya;if(i){t=s.obj.merge(e,{keySystems:Ka(e.key_systems)});if(e.keySystemOptions){t=s.obj.merge(t,{keySystems:Qa(e.keySystemOptions)})}}if(!Ya){let e="Cannot use keys for a DRM-protected source because the EME API is unavailable.";if(Ly.isSecureContext===false){e+=" The player is not running in a secure context, e.g. an HTTPS domain."}s.log.warn(e)}return t};return e};const Za=(e,i)=>{const s=Ja(e);const n=Ha(e);e.use("*",function(e){return{setSource(e,t){e=s(e);if(e.keySystems){e.keySystems=n(e.keySystems);if(e.keySystems["com.apple.fps.1_0"]){i.eme.initLegacyFairplay()}}return t(null,e)}}})};const eo=Ny.documentElement;const to=Ny.body;const io=()=>{return{top:0,left:0,right:eo.clientWidth||to.clientWidth,width:eo.clientWidth||to.clientWidth,bottom:eo.clientHeight||to.clientHeight,height:eo.clientHeight||to.clientHeight}};const so=(e,t)=>{const i=Math.max(e.top,t.top);const s=Math.min(e.bottom,t.bottom);const n=Math.max(e.left,t.left);const r=Math.min(e.right,t.right);const a=r-n;const o=s-i;return a>=0&&o>=0&&{top:i,bottom:s,left:n,right:r,width:a,height:o}};const no=(e,t)=>{const i=t.dom.getBoundingClientRect(e);const s=io();const n=so(s,i);const r=i.width*i.height;const a=n.width*n.height;if(r){return a/r}return 0};const ro=t=>{class e{constructor(i,e,s,t){this.el_=i;this.callback_=s;this.supportsIO_=t;this.observing_=false;if(t===undefined){this.supportsIO_="IntersectionObserver"in Ly&&"IntersectionObserverEntry"in Ly&&"intersectionRatio"in Ly.IntersectionObserverEntry.prototype}if(this.supportsIO_){this.io_=new Ly.IntersectionObserver(t=>{for(let e=0;e<t.length;e++){if(t[e].target===i){return s(t[e].intersectionRatio)}}},{threshold:e})}else{this.boundCheckForIntersection_=pt(e=>this.checkForIntersection_(e),500)}}observe(){if(this.observing_){return}this.observing_=true;if(this.supportsIO_){this.io_.observe(this.el_)}else{t.on(Ly,"resize",this.boundCheckForIntersection_);t.on(Ny,"scroll",this.boundCheckForIntersection_)}}unobserve(){if(!this.observing_){return}this.observing_=false;if(this.supportsIO_){this.io_.unobserve(this.el_)}else{t.off(Ly,"resize",this.boundCheckForIntersection_);t.off(Ny,"scroll",this.boundCheckForIntersection_)}}dispose(){this.unobserve();this.io_=null;this.el_=null;this.callback_=null}checkForIntersection_(){if(Ly.getComputedStyle(this.el_).display==="none"){return}const e=no(this.el_,t);this.callback_(e)}}return e};const ao={viewabilityThreshold:.6,minDurationForViewableImpression:2e3,thresholdPercentageIncrement:5,delayAutoplayIfNotViewable:false,delayAutoplayOnMobileOnly:false,pauseWhenNotViewable:false,useIntersectionObserver_:undefined,pauseInBackgroundTab:false,pauseOnBlur:false};const oo={delayAutoplayIfNotViewable:true,pauseInBackgroundTab:true,pauseWhenNotViewable:true,viewabilityThreshold:.6,minDurationForViewableImpression:2e3,thresholdPercentageIncrement:5,useIntersectionObserver_:undefined,delayAutoplayOnMobileOnly:false};const lo=n=>{const t=ro(n);const e=n.getPlugin("plugin");class i extends e{constructor(e,t){super(e);this.options=n.obj.merge(ao,t);if(es(e)){this.options=n.obj.merge(oo,t)}this.log=e.log.createLogger("viewability");this.log.level(this.options.debug?"debug":"off");this.log.debug("init",this.options);this.adImpressionTimeout_=null;this.player.ready(()=>{if(this.shouldDelayAutoplay_()){this.delayAutoplayIfNotViewable_()}else{this.pauseWhenNotViewable_()}this.player.addClass("vjs-viewability");if(this.player.usingPlugin("ads")){this.setupViewableAdImpression_()}if(this.options.pauseInBackgroundTab){this.enablePauseInBackgroundTab_()}if(this.options.pauseOnBlur){this.enablePauseOnBlur_()}this.observe_()});this.adImpressionViewabilityChangeHandler_=this.adImpressionViewabilityChangeHandler_.bind(this);this.onVisibilityChange_=this.onVisibilityChange_.bind(this);Ny.addEventListener("visibilitychange",this.onVisibilityChange_)}shouldDelayAutoplay_(){const{delayAutoplayIfNotViewable:e,delayAutoplayOnMobileOnly:t}=this.options;const{IS_ANDROID:i,IS_IOS:s}=n.browser;if(!e||!this.player.autoplay()){return false}return!t||i||s}buildThresholdArray_(){let e=0;const t=[];while(e<100){t.push((e+=this.options.thresholdPercentageIncrement)/100)}return t}observe_(){const e=this.player.el();if(!this.vo_){this.vo_=new t(e,this.buildThresholdArray_(),e=>this.onViewableChange_(e),this.options.useIntersectionObserver_)}this.vo_.observe()}onViewableChange_(e){if(!this.state){return}const t=Math.ceil(e*100)/100;const i=t>=this.options.viewabilityThreshold;const s=this.state.viewable===undefined||this.state.viewable&&!i||!this.state.viewable&&i;if(s){const n=i?"viewable":"not-viewable";this.player.trigger({type:"usage",name:n});this.player.trigger({type:"usage",name:`${n}-${t}`})}this.setState({viewablePercent:t,viewable:i});this.log.debug("viewability changed",{viewable:i,viewablePercent:t});this.player.trigger({type:a,viewable:i,viewablePercent:t});if(s){this.player.trigger({type:$s,viewable:i,viewablePercent:t})}}delayAutoplayIfNotViewable_(){const e=this.options.delayAutoplayIfNotViewable;if(!e){return}this.log.debug("delaying autoplay until viewable");const t=this.player.ima3;const i=t&&t.settings.playerMode==="outstream";let s=false;if(i){this.log.debug("listening for adsready");this.player.one("adsready",()=>{s=true;this.log.debug("adsready seen")})}const n=this.player.autoplay();const r=e=>{if(e.viewable){this.player.addClass("vjs-waiting-for-autoplay");if(i&&!s){this.player.one("adsready",()=>{this.player.autoplay(n)})}else{this.player.autoplay(n)}this.player.off(a,r)}};this.player.autoplay(false);this.player.removeClass("vjs-waiting-for-autoplay");this.player.on(a,r);this.player.one("play",()=>{this.player.removeClass("vjs-ima3-not-playing-yet");this.player.off(a,r);this.pauseWhenNotViewable_()})}pauseWhenNotViewable_(){if(!this.options.pauseWhenNotViewable){return}this.autoPaused_=false;const e=e=>{const t=this.player.paused();if(e.viewable&&t&&this.autoPaused_){this.player.play()}else if(!e.viewable&&!t){this.player.pause();this.autoPaused_=true;this.player.one("play",()=>{this.autoPaused_=false})}};this.player.on($s,e)}onVisibilityChange_(){const e=Ny.visibilityState;if(e==="hidden"&&this.state&&this.state.viewablePercent!==0){this.viewablePercent=this.state.viewablePercent;this.onViewableChange_(0)}else if(e==="visible"&&this.viewablePercent!==undefined){this.onViewableChange_(this.viewablePercent)}}startAdImpressionTimeout_(){this.adImpressionTimeout_=this.player.setTimeout(()=>{this.player.trigger("viewable-ad-impression");this.log.debug("viewable-ad-impression");this.player.trigger({type:"usage",name:"viewable-ad-impression"});this.player.trigger({type:"usage",name:`viewable-ad-impression-${this.state.viewablePercent}`});this.adImpressionTimeout_=null;this.player.off(a,this.adImpressionViewabilityChangeHandler_)},this.options.minDurationForViewableImpression)}stopAdImpressionTimeout_(){Ly.clearTimeout(this.adImpressionTimeout_);this.adImpressionTimeout_=null}adImpressionViewabilityChangeHandler_(e){if(e.viewable){if(!this.adImpressionTimeout_){this.startAdImpressionTimeout_()}}else if(this.adImpressionTimeout_){this.stopAdImpressionTimeout_()}}setupViewableAdImpression_(){this.player.on("ads-ad-started",()=>{if(this.state.viewable){this.startAdImpressionTimeout_()}this.player.on(a,this.adImpressionViewabilityChangeHandler_);this.player.any(["adend","adtimeout","adserror"],()=>{this.player.off(a,this.adImpressionViewabilityChangeHandler_)})})}enablePauseInBackgroundTab_(){this.pausedInBackground_=false;const e=()=>{const e=this.player.paused();const t=Ny.visibilityState;if(t==="hidden"&&!e&&!this.pausedInBackground_){this.player.pause();this.pausedInBackground_=true}else if(t==="visible"&&e&&this.pausedInBackground_){this.player.play();this.pausedInBackground_=false}};this.player.on("VIEWABLE_CHANGE",e)}enablePauseOnBlur_(){const e=()=>{if(!this.player.paused()&&!this.pausedOnBlur_){this.player.pause();this.pausedOnBlur_=true}};const t=()=>{if(this.player.paused()&&this.pausedOnBlur_){this.player.play();this.pausedOnBlur_=false}};const i=()=>{Ly.removeEventListener("blur",e,true);Ly.removeEventListener("focus",t,true)};this.pausedOnBlur_=false;this.player.ready(()=>{if(!Ny.hasFocus()&&!this.player.paused()){this.player.pause();this.pausedOnBlur_=true}});Ly.addEventListener("blur",e,true);Ly.addEventListener("focus",t,true);this.player.on("dispose",i)}}i.defaultState={viewable:undefined,viewablePercent:undefined};n.registerPlugin("viewability",i)};const co={hidden:"hidden",off:"off",ready:"ready"};const uo=(e,t)=>{const i=e.name||e.id;if(!i){return t==="mp4"?"video":"videoTranscript"}return i.replace(/[^0-9a-z-A-Z]/g,"")};const ho=(e,t,i)=>{const s=i==="mp4"?"mp4":"txt";const n=Ny.createElement("a");n.href=e;n.target="_blank";n.download=`${t}.${s}`;Ny.body.appendChild(n);n.click();Ny.body.removeChild(n)};const fo=(e,t,i)=>{t.removeClass("has-icon-downloading");t.addClass("has-icon-file-download");e.removeClass("vjs-video-downloading");const s=`Download ${i==="mp4"?"Video":"Transcript"}`;t.setAttribute("aria-label",t.localize(s));t.controlText(s)};const po=(i,s,e,n,r)=>{fetch(e).then(e=>e.blob()).then(e=>{const t=URL.createObjectURL(e);ho(t,n,r);fo(i,s,r);i.trigger({name:n,type:"download-finished"});URL.revokeObjectURL(t)}).catch(e=>{fo(i,s,r);i.trigger({err:e,type:"download-failed"})})};const mo=(e,t)=>{if(e.hasClass("vjs-video-downloading")){return}const i=t.options();const s=i.source;const n=i.type;const r=uo(e.mediainfo,n);e.addClass("vjs-video-downloading");t.removeClass("has-icon-file-download");t.addClass("has-icon-downloading");t.setAttribute("aria-label",t.localize("Downloading"));t.controlText("Downloading");e.trigger("download-started");po(e,t,s,r,n)};const go=v.getComponent("Button");class yo extends go{constructor(e,t={}){super(e,t);const i={[co.hidden]:this.onHiddenState,[co.off]:this.onOffState,[co.ready]:this.onReadyState};const s=i[t.state];s.call(this,e,t.type)}onHiddenState(e){this.addClass("vjs-hidden");e.trigger("download-hidden")}onReadyState(e,t){const i=`Download ${t==="mp4"?"Video":"Transcript"}`;this.el_.setAttribute("aria-label",this.localize(i));this.controlText(i);this.addClass("has-icon-file-download");e.trigger("download-ready")}onOffState(e){this.el_.setAttribute("aria-label",this.localize("No downloadable item available"));this.controlText("No downloadable item available");this.addClass("has-icon-file-download-off");this.disable();e.trigger("download-disabled")}handleClick(){mo(this.player(),this)}buildWrapperCSSClass(){return`vjs-download-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`vjs-download-button ${super.buildCSSClass()}`}}v.registerComponent("DownloadButton",yo);function _o(e){if(typeof e!=="string"){return false}let t={};try{t=new URL(e)}catch(e){}return t.protocol==="https:"}function vo(){const t=W.preferHttps(Ly);return e=>t?_o(e.src):!_o(e.src)}const bo=(e,t)=>{let i;const s=e.language()||"en";const n=t.filter(vo());i=n.find(e=>e.src_lang===s);if(!i){i=n.find(e=>{return e.src_lang&&e.src_lang.slice(0,2)===s.slice(0,2)})}if(!i&&n.length){i=n[0]}return i};const To=(e,t)=>{let i;let s;const n=e.mediainfo.sources||[];const r=e.mediainfo.transcripts||[];if(t==="mp4"){i=n.filter(vo()).filter(e=>e.container==="MP4"&&e.hasOwnProperty("src")&&e.hasOwnProperty("size")).sort((e,t)=>t.size-e.size);s=i[0]&&i[0].src}if(t==="transcript"){const a=bo(e,r);s=a&&a.src}return s};const So=(e,t)=>{const i=To(e,t.type);const s=Array.isArray(e.mediainfo.tags)&&e.mediainfo.tags.find(e=>e==="downloadable");if(!s){return co.hidden}if(!i){return co.off}return co.ready};const Eo=(e,t)=>{e.addClass("vjs-download-video");t.source=To(e,t.type);t.state=So(e,t);const i=e.getChild("controlBar");const s=i.addChild("DownloadButton",t,i.children_.length-2);return function(){e.removeClass("vjs-download-video");i.removeChild(s);s.dispose()}};const wo=e=>{function t(e={}){if(typeof this.downloadButton==="undefined"){return}let t=()=>{};this.ready(()=>{t=Eo(this,e);this.on("loadstart",()=>{t();t=Eo(this,e)});this.downloadButton=()=>{};this.downloadButton.source=e.source;this.downloadButton.state=e.state})}e.registerPlugin("downloadButton",t);t.VERSION=D};const Io=new Ly.Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});const Co=URL.createObjectURL(Io);const ko=["perSourceBehaviors","contextmenu","contextmenuUI","bcAnalytics","errors","catalog","downloadButton","playerInfo","plugin","reloadSourceOnError","playlist","endscreen","proxyTracks","seekEvents","touchActive","urlparams","encryptedWatcher","viewability","headerBidding"];const Ao=function(n,l,e){const r=e.settings;const t={};const i=Boolean(l.options_.debug);const a={chromecastReceiver:{debug:i},ima3:{debugContribAds:i},ssai:{debug:i},vr:{debug:i}};l.on("pluginsetup",(e,t)=>{const{name:i}=t;if(ko.indexOf(i)!==-1){return}l.trigger({type:"usage",name:`${i}!${n.getPluginVersion(i)}`})});const o=function(t,e={}){const i=a[t]||{};if(!l.hasPlugin(t)){n.log.error(`Plugin "${t}" is missing. Please check your player configuration.`);return}if(l.usingPlugin(t)){return}const s=n.obj.merge(i,e);try{l[t](s)}catch(e){n.log.error(`Unable to initialize "${t}" plugin:`,e)}};if(r.usingAdFailover&&r.usingIMAPrerollWithSSAI){n.log.warn("Ad failover is not compatible with SSAI and client-side preroll. "+"Please configure only one. This player will use ad failover behavior.");delete r.usingIMAPrerollWithSSAI}if(r.usingAdFailover){l.trigger({type:"usage",name:"ad-failover"});const{name:h,options:f}=l.usingAdBlocker.mightBe?r.serverSideAdPlugin:r.clientSideAdPlugin;o(h,f)}else if(r.usingIMAPrerollWithSSAI){if(Ly.bc.disposedAfterPreroll_){const p=r.serverSideAdPlugin.name;const m=r.serverSideAdPlugin.options;const g=r.clientSideAdPlugin.name;n.deregisterPlugin(g);n.registerPlugin(p,Ly.bc.ssaiPluginCache_);o(p,m)}else{l.trigger({type:"usage",name:"ssai-with-ima-preroll"});const g=r.clientSideAdPlugin.name;const y=r.clientSideAdPlugin.options;const p=r.serverSideAdPlugin.name;Ly.bc.ssaiPluginCache_=n.getPlugin("ssai");n.deregisterPlugin(p);o(g,y);const _=l.tagAttributes;l.one(["adend","adtimeout","adserror"],function(o){l.one("playing",function(){let t=l.volume();let i=l.muted();if(o.type==="adend"){if(l.ima3&&l.ima3.adPlayer){t=l.ima3.adPlayer.volume();i=l.ima3.adPlayer.muted()}else{t=l.ima3.player.volume();i=l.ima3.player.muted()}}const e=l.el();const s=e.parentNode;const n=Ny.createElement("div");s.replaceChild(n,e);l.dispose();Ly.bc.disposedAfterPreroll_=true;const r=Ny.createElement("video-js");Object.keys(_).forEach(e=>{r.setAttribute(e,_[e])});s.replaceChild(r,n);const a=Ly.bc(_.id);a.bigPlayButton.hide();a.ready(function(){a.one("playing",()=>{Ly.bc.disposedAfterPreroll_=false});const e=a.play();if(e.then){e.catch(()=>{a.bigPlayButton.show()})}a.volume(t);a.muted(i)})})})}}r.plugins.forEach(function({autoInit:e,name:t,options:s={}}){if(!e){return}const n=r.videoCloud&&r.videoCloud.bumper;if(t==="catalog"&&n&&n.id){let{showControls:e,progressBarColor:t,preventSeeking:i}=n;e=e&&Boolean(e)||true;i=Boolean(i);s.bumper=w(n,{showControls:e,progressBarColor:t,preventSeeking:i})}const i=r.playerMode;if(t==="ima3"&&i){s.playerMode=i}o(t,s)});const{media:s,videoCloud:c}=r;const u=s&&!!(s.sources||s.length&&s[0].sources);if(c&&c.policyKey&&!u){const v={embedHasPoster:r.embedState.poster,embedHasSources:r.embedState.sources,embedHasTracks:r.embedState.tracks,adConfigId:r.adConfigId,deliveryConfigId:r.deliveryConfigId,bumper:r.videoCloud&&r.videoCloud.bumper};if(c.playlist){l.trigger({type:"usage",name:"catalog-playlist"});v.playlistId=c.playlist}if(c.video){l.trigger({type:"usage",name:"catalog-video"});v.videoId=c.video}if(c.search){l.trigger({type:"usage",name:"catalog-search"});v.search=c.search}if(c.sequence){l.trigger({type:"usage",name:"catalog-sequence"});v.sequence=c.sequence}let e;if(r.usingIMAPrerollWithSSAI&&!Ly.bc.disposedAfterPreroll_){l.src({src:Co,type:"video/mp4"})}else if(c.autoLoad!==false){e=t.catalogMedia=l.catalog.autoFindAndLoadMedia(v)}if(e&&e.type==="video"){if(/^[\d]+$/.test(e.id)){l.mediainfo.id=e.id}else{l.mediainfo.referenceId=l.mediainfo.reference_id=e.id}}l.on("loadstart",()=>{if(l.language()&&l.catalog.getMetadata({lang:l.language()})){l.trigger({type:"usage",name:"variant:"+l.language()})}})}if(l.usingPlugin("bcAnalytics")){const b=function(){return(new Date).toISOString().split("T")[0]+":"+l.bcAnalytics.client.getSession()};l.ready(function(){W.perf.mark("bcInitEnd");W.perf.measure("bcInit","bcInitStart","bcInitEnd");if(l.usingPlugin("playerInfo")){l.playerInfo.modal.on("modalfill",function(){const e=b();const t=l.playerInfo.modal.$(".vjs-pi-section tbody");if(!e||!t){return}const i=Ny.createElement("tr");const s=Ny.createElement("tr");i.innerHTML="<td>"+l.localize("Session ID")+"</td> <td>"+e+"</td>";t.appendChild(i);s.innerHTML="<td>"+l.localize("Player Element ID")+"</td> <td>"+l.id()+"</td>";t.appendChild(s)})}});if(l.usingPlugin("errors")){l.errorDisplay.on("modalfill",function(){const e=b();const t=l.errorDisplay.$(".vjs-errors-content-container");if(!e||!t){return}t.appendChild(n.dom.createEl("div",{className:"vjs-errors-ref-id",innerHTML:"<b>"+l.localize("Session ID:")+"</b> "+e+" "+"<b>"+l.localize("Player Element ID:")+"</b> "+l.id()}))})}}if(l.usingPlugin("playerInfo")){l.on("contextmenu",function(){if(l.playerInfo.modal){l.playerInfo.modal.close()}})}const d=l.getChild("TitleBar");if(d&&r.hasTitleBar!==false){const T=s&&(s[0]&&s[0].title||s.title)||"";const S=s&&(s[0]&&s[0].description||s.description)||"";const E=function(){if(l.controls()){const{mediainfo:t}=l;const i=l.language()||"";let e;if(l.usingPlugin("catalog")){e=l.catalog.getMetadata({lang:i})}d.update({title:e&&e.name||t&&t.name||l.getMedia().title||T,description:e&&e.description||t&&t.description||l.getMedia().description||S})}};E();l.on(["loadstart","loadedmetadata","languagechange"],E)}return t};const Do=(e,t)=>{let i;const s=Ny.createElement("script");s.src=e;s.onload=function(){if(!i){i=true;t()}};s.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){if(!i){i=true;t()}}};const n=Ny.getElementsByTagName("head")[0];if(n){n.appendChild(s)}};const xo=()=>{try{return Ly.location.hostname.split(".").length}catch(e){return 3}};const Oo=e=>{let i;if(e){const s=e.split("&");for(let e=0,t=s.length;e<t;e+=1){const n=s[e].split("=");if(n.length===2&&n[0]==="GUID"){i=n[1].toLowerCase().replace(new RegExp("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w+)"),"$1-$2-$3-$4-$5")}}}return i};var Y={loadScript:Do,getEloquaGuid:Oo,getMarketoDomainLevel:xo};const X=e=>{const i=e+"=";const s=Ny.cookie.split(";");for(let t=0,e=s.length;t<e;t+=1){let e=s[t];while(e.charAt(0)===" "){e=e.substring(1)}if(e.indexOf(i)===0){return e.substring(i.length,e.length)}}return null};const Po=["ads-pod-ended","adserror","adtimeout"];function Ro(t,i){const e=i.outstream;if(e){const{reveal:s,dispose:n}=e;const r=t.tech_.width();const a=t.tech_.height();if(s){Vt(i,0,1);const o=e=>{if(e.viewable){Vt(i,r,a);t.off("viewable-change",o)}};t.on("viewable-change",o)}if(n){let e=null;if(t.el().parentElement){const l=t.el().parentElement.classList;if(l.contains("vjs-pip-container")||l.contains("vjs-pinning-container")){e=t.el().parentElement}}t.on(Po,()=>{t.dispose();if(e){e.remove()}})}}}const Lo=e=>{if(typeof e!=="string"){return null}const t=e.toLowerCase();return t==="production"||t==="qa"||t==="staging"?t:null};class No{constructor(e,t){this.runtime_=t;const i={};Object.keys(W).forEach(e=>{const t=W[e];Object.defineProperty(i,e,{enumerable:true,value:t,writable:false})});Object.defineProperty(this,"util",{enumerable:true,value:i,writable:false})}getRuntime(){return this.runtime_}}var Mo="Expected a function";var Uo="__lodash_hash_undefined__";var Bo=1/0;var Fo="[object Function]",qo="[object GeneratorFunction]",jo="[object Symbol]";var Vo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$o=/^\w*$/,Ho=/^\./,Go=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var zo=/[\\^$.*+?()[\]{}|]/g;var Wo=/\\(\\)?/g;var Yo=/^\[object .+?Constructor\]$/;var Xo=typeof Ry=="object"&&Ry&&Ry.Object===Object&&Ry;var Ko=typeof self=="object"&&self&&self.Object===Object&&self;var Qo=Xo||Ko||Function("return this")();function Jo(e,t){return e==null?undefined:e[t]}function Zo(e){var t=false;if(e!=null&&typeof e.toString!="function"){try{t=!!(e+"")}catch(e){}}return t}var el=Array.prototype,tl=Function.prototype,il=Object.prototype;var sl=Qo["__core-js_shared__"];var nl=function(){var e=/[^.]+$/.exec(sl&&sl.keys&&sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var rl=tl.toString;var al=il.hasOwnProperty;var ol=il.toString;var ll=RegExp("^"+rl.call(al).replace(zo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var cl=Qo.Symbol,ul=el.splice;var dl=Fl(Qo,"Map"),hl=Fl(Object,"create");var fl=cl?cl.prototype:undefined,pl=fl?fl.toString:undefined;function ml(e){var t=-1,i=e?e.length:0;this.clear();while(++t<i){var s=e[t];this.set(s[0],s[1])}}function gl(){this.__data__=hl?hl(null):{}}function yl(e){return this.has(e)&&delete this.__data__[e]}function _l(e){var t=this.__data__;if(hl){var i=t[e];return i===Uo?undefined:i}return al.call(t,e)?t[e]:undefined}function vl(e){var t=this.__data__;return hl?t[e]!==undefined:al.call(t,e)}function bl(e,t){var i=this.__data__;i[e]=hl&&t===undefined?Uo:t;return this}ml.prototype.clear=gl;ml.prototype["delete"]=yl;ml.prototype.get=_l;ml.prototype.has=vl;ml.prototype.set=bl;function Tl(e){var t=-1,i=e?e.length:0;this.clear();while(++t<i){var s=e[t];this.set(s[0],s[1])}}function Sl(){this.__data__=[]}function El(e){var t=this.__data__,i=Rl(t,e);if(i<0){return false}var s=t.length-1;if(i==s){t.pop()}else{ul.call(t,i,1)}return true}function wl(e){var t=this.__data__,i=Rl(t,e);return i<0?undefined:t[i][1]}function Il(e){return Rl(this.__data__,e)>-1}function Cl(e,t){var i=this.__data__,s=Rl(i,e);if(s<0){i.push([e,t])}else{i[s][1]=t}return this}Tl.prototype.clear=Sl;Tl.prototype["delete"]=El;Tl.prototype.get=wl;Tl.prototype.has=Il;Tl.prototype.set=Cl;function kl(e){var t=-1,i=e?e.length:0;this.clear();while(++t<i){var s=e[t];this.set(s[0],s[1])}}function Al(){this.__data__={hash:new ml,map:new(dl||Tl),string:new ml}}function Dl(e){return Bl(this,e)["delete"](e)}function xl(e){return Bl(this,e).get(e)}function Ol(e){return Bl(this,e).has(e)}function Pl(e,t){Bl(this,e).set(e,t);return this}kl.prototype.clear=Al;kl.prototype["delete"]=Dl;kl.prototype.get=xl;kl.prototype.has=Ol;kl.prototype.set=Pl;function Rl(e,t){var i=e.length;while(i--){if(Wl(e[i][0],t)){return i}}return-1}function Ll(e,t){t=ql(t,e)?[t]:Ul(t);var i=0,s=t.length;while(e!=null&&i<s){e=e[Hl(t[i++])]}return i&&i==s?e:undefined}function Nl(e){if(!Kl(e)||Vl(e)){return false}var t=Xl(e)||Zo(e)?ll:Yo;return t.test(Gl(e))}function Ml(e){if(typeof e=="string"){return e}if(Jl(e)){return pl?pl.call(e):""}var t=e+"";return t=="0"&&1/e==-Bo?"-0":t}function Ul(e){return Yl(e)?e:$l(e)}function Bl(e,t){var i=e.__data__;return jl(t)?i[typeof t=="string"?"string":"hash"]:i.map}function Fl(e,t){var i=Jo(e,t);return Nl(i)?i:undefined}function ql(e,t){if(Yl(e)){return false}var i=typeof e;if(i=="number"||i=="symbol"||i=="boolean"||e==null||Jl(e)){return true}return $o.test(e)||!Vo.test(e)||t!=null&&e in Object(t)}function jl(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Vl(e){return!!nl&&nl in e}var $l=zl(function(e){e=Zl(e);var n=[];if(Ho.test(e)){n.push("")}e.replace(Go,function(e,t,i,s){n.push(i?s.replace(Wo,"$1"):t||e)});return n});function Hl(e){if(typeof e=="string"||Jl(e)){return e}var t=e+"";return t=="0"&&1/e==-Bo?"-0":t}function Gl(e){if(e!=null){try{return rl.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function zl(n,r){if(typeof n!="function"||r&&typeof r!="function"){throw new TypeError(Mo)}var a=function(){var e=arguments,t=r?r.apply(this,e):e[0],i=a.cache;if(i.has(t)){return i.get(t)}var s=n.apply(this,e);a.cache=i.set(t,s);return s};a.cache=new(zl.Cache||kl);return a}zl.Cache=kl;function Wl(e,t){return e===t||e!==e&&t!==t}var Yl=Array.isArray;function Xl(e){var t=Kl(e)?ol.call(e):"";return t==Fo||t==qo}function Kl(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ql(e){return!!e&&typeof e=="object"}function Jl(e){return typeof e=="symbol"||Ql(e)&&ol.call(e)==jo}function Zl(e){return e==null?"":Ml(e)}function ec(e,t,i){var s=e==null?undefined:Ll(e,t);return s===undefined?i:s}var tc=ec;var ic=Fe(tc);const sc="vjs-waiting-for-autoplay";function nc(s,e,c,t){const i=c.options_;const{settings:u,environment:n}=e;const{accountId:r,applicationId:a,css:M,embedId:o,playerId:l,videoCloud:d,analytics:h,chinaProxyDomain:f,version:U,viewability:p,playerVersionLocked:B,watermarkingToken:m,tveToken:g,emeOptions:y}=u;const _=Lo(u.env);const F=zs(u.playerName);c.brightcove=new No(c,e);let q;c.mediainfo={accountId:r,account_id:r};c.bcinfo={accountId:r,applicationId:a,css:M,embedId:o,playerId:l,scriptUrl:n.scriptUrl,scriptBaseUrl:n.scriptBaseUrl};Object.defineProperty(c,"usingAdBlocker",{enumerable:true,value:Yt});Object.defineProperty(c,"getAutoplayConditions",{enumerable:true,value:e=>t.getAutoplayConditions(e)});Object.defineProperty(c,"getAccountId",{enumerable:true,value(){return t.runtime.settings.accountId}});Object.defineProperty(c,"getApplicationId",{enumerable:true,value(){return t.runtime.settings.applicationId}});Object.defineProperty(c,"setAccountId",{enumerable:true,value(e){if(W.isNil(e)){s.log.warn("account ID must be a string or number");return}t.runtime.settings.accountId=e;this.bcinfo.accountId=e;this.mediainfo.accountId=this.mediainfo.account_id=e}});Object.defineProperty(c,"setApplicationId",{enumerable:true,value(e){if(!W.isNonEmptyStr(e)){s.log.warn("application ID must be a string");return}t.runtime.settings.applicationId=e;this.bcinfo.applicationId=e;if(c.bcAnalytics){c.bcAnalytics.setApplicationId(e)}}});Yt().then(function(e){if(e){c.trigger({type:"usage",name:"using-ad-blocker"})}});if(u.classNames&&u.classNames.player){c.addClass(u.classNames.player)}if(u.classNames&&u.classNames.playerInstance){c.addClass(u.classNames.playerInstance)}const j=c.dimension.bind(c);c.dimension=function(e,t){if(e==="width"){Vt(u,t,null)}else if(e==="height"){Vt(u,null,t)}return j(e,t)};c.ready(function(){if(!i.autoplay){return}function e(){c.removeClass(sc)}if(!c.currentSrc()&&!q){e()}else{c.any(["autoplay-success","autoplay-failure","error"],e)}});c.on("loadedmetadata",()=>{if(!i.width&&!i.height&&!c.audioOnlyMode()){Vt(u,c.tech_.width(),c.tech_.height())}});if(es(c)){Ro(c,u)}if(u.fullscreenControl===false&&c.controls()){c.on("canplay",function(){if(!c.controlBar){return}const t=c.controlBar.children();if(!t||!t.length){return}for(let e=t.length-1;e>0;e--){if(t[e].hasClass("vjs-menu-button-popup")&&!t[e].hasClass("vjs-hidden")){t[e].addClass("vjs-menu-popup-last-visible");break}}})}if(s.browser.IS_IPHONE){c.on("fullscreenchange",function(){const e=c.$(".vjs-tech");if(e.hasAttribute("controls")){e.removeAttribute("controls")}});if(u.embedState.playsinline&&u.embedState.muted){c.addClass("vjs-iphone")}}if(i.autoplay&&s.browser.IS_IOS&&s.browser.IS_ANY_SAFARI){const A=c.$(".vjs-tech");if(!A.autoplay){A.autoplay=true}}if(s.browser.IS_IOS&&u.embedState.muted){c.addClass("vjs-ios")}if(c.controls()){c.one("play",function(){if(!c.controlBar||!c.controls()){return}const t=c.controlBar.children();if(!t||!t.length){return}const i=["Enter","ArrowDown","ArrowUp","Up","Down"," ","Spacebar"];for(let e=0;e<t.length;e++){if(t[e].hasClass("vjs-menu-button-popup")&&!t[e].hasClass("vjs-hidden")){t[e].on("keyup",function(e){if(i.indexOf(e.key)>=0){c.controlBar.addClass("vjs-control-bar-visible")}})}}});if(c.controlBar){const D=c.controlBar.el();let t;const x=function(){const e=Ny.activeElement;if(t!==e){t=e;c.controlBar.toggleClass("vjs-focus-within",D.contains(e))}};const O=function(){D.removeEventListener("focus",x,true);D.removeEventListener("blur",x,true)};D.addEventListener("focus",x,true);D.addEventListener("blur",x,true);c.on("dispose",O);c.controlBar.on("dispose",O)}}c.one("beforepluginsetup:ads",function(){const e=c.getChild("controlBar");if(e){e.removeChild("pictureInPictureToggle")}s.getComponent("Component").prototype.fsApi_=c.fsApi_});if(!s.browser.TOUCH_ENABLED){c.addClass("vjs-mouse");if(n.isInBcFrame){s.dom.addClass(Ny.documentElement,"vjs-mouse")}}else if(s.browser.IS_IPHONE){c.addClass("vjs-native")}c.requestAnimationFrame(function(){const e=Ny.querySelector(".bc-wrap");c.addClass("vjs-plugins-ready");if(e){e.style.opacity=0}});c.on(["mouseenter","ended","touchend"],function(){c.removeClass("vjs-hide-controls")});c.on("mouseleave",function(){c.addClass("vjs-hide-controls");if(!c.controlBar||!c.controlBar.el()){return}if(c.controlBar.hasClass("vjs-control-bar-visible")){c.controlBar.removeClass("vjs-control-bar-visible")}});if(!s.browser.IS_ANY_SAFARI&&!u.multilingualMetadataTracksDisabled){c.one("loadeddata",function(){if(c.language()!==undefined&&c.catalog&&c.catalog.getMetadata().variants!==undefined){const i=c.language()||"";const s=c.textTracks();if(s){const n=Array.prototype.filter.call(s,e=>(e.kind==="captions"||e.kind==="subtitles")&&e.mode==="showing");let e;let t;if(!n.length){for(t=0;t<s.length;t++){e=s[t];if((e.kind==="captions"||e.kind==="subtitles")&&e.language.toLowerCase()===i.toLowerCase()){e.mode="showing";return}}for(t=0;t<s.length;t++){e=s[t];if((e.kind==="captions"||e.kind==="subtitles")&&e.language.toLowerCase()===i.substring(0,2).toLowerCase()){e.mode="showing";return}}}}}})}let v;const b=e=>{if(e){c.addClass("vjs-audio-mode")}else{c.removeClass("vjs-audio-mode")}};const V=e=>{const i=c.getChild("PosterImage").el_.style;const t=()=>{const e=c.getChild("ControlBar");const t=e&&e.currentHeight();i.paddingBottom=`${t}px`;i.backgroundOrigin="content-box"};if(e){c.one("play",t)}else{c.off("play",t);i.paddingBottom="";i.backgroundOrigin=""}};c.on("loadedmetadata",()=>{const e=c.currentSource();const t=e.type.includes("audio")||e.codecs==="mp4a";const i=c.audioPosterMode();const s=c.audioOnlyMode();if(!u.audioPosterMode&&!u.audioOnlyMode&&t&&!v||!i&&!s&&t&&v){c.audioPosterMode(true)}else if(!t&&i&&!u.audioPosterMode&&v){c.audioPosterMode(false)}v=true});c.on("audiopostermodechange",()=>{const e=c.audioPosterMode();const t=c.audioOnlyMode();if(e){V(true);b(true)}else if(!t&&!e){V(false);b(false)}});c.on("audioonlymodechange",()=>{const e=c.audioPosterMode();const t=c.audioOnlyMode();if(t){const i=c.currentHeight();const s=c.getChild("ControlBar");const n=s&&s.getChild("ProgressControl");const r=n?n.currentHeight():0;b(true);c.height(i+r)}else if(!t&&!e){b(false)}});if(u.videoCloud&&u.videoCloud.bumper){const P=c.getChild("ControlBar");const R=P.getChild("ProgressControl");const L=u.videoCloud.bumper;c.on("bumper-play",()=>{if(L.preventSeeking){R.disable()}const e=P.getChild("NextButton");if(e){e.hide()}c.addClass("vjs-bumper-video")});c.on("bumper-ended",()=>{if(L.preventSeeking){R.enable()}const e=P.getChild("NextButton");if(e){e.show()}c.removeClass("vjs-bumper-video")})}const $=e.environment&&e.environment.queryString||{};let T;const H=s=>{if(u.viewerId){T=u.viewerId;s();return}if(u.viewerIdSource){const n=u.viewerIdSource;let t;let i;switch(n.source){case"eloqua":i=X("ELOQUA");T=Y.getEloquaGuid(i);if(!T){t=n.endpoint+"/visitor/v200/svrGP.aspx?pps=70&siteid="+n.site+"&ms="+(new Date).getMilliseconds();Y.loadScript(t,()=>{if(typeof GetElqCustomerGUID==="function"){T=GetElqCustomerGUID();s()}})}else{s()}break;case"hubspot":const r=()=>{T=X("hubspotutk");s()};if(Ly._hsq){r()}else{t="//js.hs-scripts.com/"+n.accountId+".js";Y.loadScript(t,()=>{if(!X("hubspotutk")){setTimeout(()=>{r()},400)}else{r()}})}break;case"marketo":t="//munchkin.marketo.net/munchkin.js";const a=()=>{i=X("_mkto_trk");T=i&&i.split(":").pop();s()};let e;if(!!n.domainLevel&&Number.isInteger(n.domainLevel)){e=n.domainLevel}Y.loadScript(t,()=>{if(Ly.Munchkin&&typeof Ly.Munchkin.init==="function"){Ly.Munchkin.init(n.accountId,{domainLevel:e||Y.getMarketoDomainLevel()});if(!X("_mkto_trk")){setTimeout(()=>{a()},200)}else{a()}}});break;case"salesforce":T=ic(Ly,u.bcsfid);if(!T){T=W.qs().search.bcsfid||c.el().getAttribute("data-bc-sfid")}s();break;case"adobe":if(typeof Ly.Visitor==="function"){const l=Ly.Visitor.getInstance(n.marketingCloudOrgId);let e;if(l){e=l.getMarketingCloudVisitorID()}T=e||X("s_vi")||X("s_fid");s()}break;case"sailthru":t="//ak.sail-horizon.com/spm/spm.v1.min.js";Y.loadScript(t,()=>{T=X("sailthru_sid");s()});break;case"gtag":const o=()=>{Ly.gtag("get",n.tagId,"client_id",e=>{T=e;s()})};if(Ly.gtag&&typeof Ly.gtag==="function"){o()}else{t=`https://www.googletagmanager.com/gtag/js?id=${n.tagId}`;Y.loadScript(t,()=>{Ly.dataLayer=Ly.dataLayer||[];Ly.gtag=function(){Ly.dataLayer.push(arguments)};Ly.gtag("js",new Date);if(typeof Ly.gtag==="function"){Ly.gtag("get",n.tagId,"client_id",e=>{T=e;o()})}})}break;case"braze":t="//js.appboycdn.com/web-sdk/5.0/braze.min.js";Y.loadScript(t,()=>{if(typeof appboy.initialize==="function"){appboy.initialize(n.apiKey);T=appboy.getUser().getUserId();s()}});break}}};const{bcShimDestripeTime:S}=n;if(S!==undefined){if(S>1){c.trigger({type:"usage",name:"sdt-"+(Math.log(S)/Math.LN10).toFixed(1)})}else{c.trigger({type:"usage",name:"sdt-0.0"})}}c.ready(function(){if(c.bcinfo&&c.bcinfo.PLAYER_LOADER||n.brightcovePlayerLoader){c.trigger({type:"usage",name:"player-loader"})}if(c.bcinfo&&c.bcinfo.REACT_PLAYER_LOADER||n.BrightcoveReactPlayerLoader){c.trigger({type:"usage",name:"react-player-loader"})}});const{debug:E}=c.options_;if(E){c.log.level("debug");c.log.history.enable()}else{c.log.level("off");c.log.history.disable()}const w={accountId:r,applicationId:a,embedId:o,mr:Boolean(Ly.bc_isManagedRelease),playerId:l,playerName:F,playerVersionLocked:B,platformVersion:U,verbose:Boolean(E)};if(f){w.analyticsUrl=`//${f}/v2/tracker`}if(_){w.env=_}if(h){if(h.analyticsUrl){w.analyticsUrl=h.analyticsUrl}if(h.env){w.env=h.env}if(h.hasOwnProperty("verbose")){w.verbose=Boolean(h.verbose)}if(h.requires_consent){w.requiresConsent=true}if(h.hasOwnProperty("native_qoe")){w.nativeQoe=Boolean(h.native_qoe)}}["referrer","usage","user"].forEach(e=>{if($[e]){w[e]=$[e]}});const I={accountId:r,policyKey:d&&d.policyKey};if(d&&d.streamConcurrency){I.streamConcurrency=d.streamConcurrency;I.maxRetry=d.maxRetry;I.intervalRetry=d.intervalRetry}if(f){I.baseUrl=`//${f}/playback/v1`}else if(d&&d.baseUrl){I.baseUrl=d.baseUrl}if(_){I.env=_}if(d&&d.sourceSelectionRules){I.sourceSelectionRules=d&&d.sourceSelectionRules}if(m){I.watermarkingToken=m}if(g){I.tveToken=g}if(d&&typeof d.allowPlayreadyInChromiumEdge==="boolean"){I.allowPlayreadyInChromiumEdge=d.allowPlayreadyInChromiumEdge}const C=[{name:"bcAnalytics",register:Js,opts:w},{name:"catalog",register:rr,opts:I},{name:"proxyTracks",register:dr,opts:{debug:E}},{name:"seekEvents",register:gr,opts:{verbose:E}},{name:"touchActive",register:yr},{name:"urlparams",register:di,opts:{iframe:n.isInBcFrame,time:u.startTime}},{name:"playerInfo",register:Cr},{name:"endscreen",register:kr},{name:"encryptedWatcher",register:fr}];const k=e.settings.contextMenu;if(k!==false){const N=[{label:c.localize("Player Information"),listener:()=>c.usingPlugin("playerInfo")&&c.playerInfo.modal.open()}];if(W.isObj(k)&&k.brightcoveBranding!==false){N.push({href:"https://www.brightcove.com/en/why-brightcove?utm_type=player",label:c.localize("About Brightcove")})}C.push({name:"contextmenuUI",opts:{content:N}})}if(p!==false){C.push({name:"viewability",register:lo,opts:p?p:{}})}const G=Ly.cast&&Ly.cast.receiver;const z=["mp4","transcript"].includes(u.downloadButton);if(z&&!G){C.push({name:"downloadButton",register:wo,opts:{type:u.downloadButton}})}C.forEach(function({name:e,opts:t,register:i}){if(!c.hasPlugin(e)){i(s)}if(!c.usingPlugin(e)){c[e](t)}});Za(s,c);if(y){c.eme(y)}else{c.eme()}({catalogMedia:q}=Ao(s,c,e));H(()=>{c.bcAnalytics.client.user(T);c.playerInfo()});c.on("dispose",()=>{c=i.runtime_=null;s.log.history.clear()})}function rc(n,r,a){const{videojs:o}=n;let l=-1;return function e(t){const i=o.getPlayer(t);if(i){i.trigger({type:"usage",name:"bc-used-as-getter"});return i}l++;const s=n.getRuntime({playerIndex:l});o.hookOnce("beforesetup",(e,t)=>{t=Qt(o,s,e,t);if(W.isFn(r)){return r(o,s,e,t)}return t});o.hookOnce("setup",e=>{nc(o,s,e,n);if(W.isFn(a)){a(o,s,e)}});return o(...arguments)}}const ac={accountId:"",adConfigId:"",applicationId:"",playsinline:false,loop:false,muted:false,autoplay:false,crossorigin:false,css:{},plugins:[],debug:false,contextMenu:{},deliveryConfigId:"",embedId:"default",misconfiguredWithMultipleAdPlugins:false,playerId:"default",skin:"luna",usingAdFailover:false,usingIMAPrerollWithSSAI:false,version:"0.0.0",videoCloud:null,playerVersionLocked:false,multilingualMetadataTracksDisabled:false};const oc={brightcovePlayerLoader:Ly.brightcovePlayerLoader,BrightcoveReactPlayerLoader:Ly.BrightcoveReactPlayerLoader,bcShimDestripeTime:Ly.bcShimDestripeTime,userAgent:Ly.navigator.userAgent};class S{constructor(e={},t={}){const{videojs:i}=S.shared;if(!i){throw new Error("missing videojs")}this.runtime={environment:i.obj.merge(oc,t),settings:i.obj.merge(ac,e)};if(this.runtime.settings.misconfiguredWithMultipleAdPlugins){i.log.warn('Brightcove Player "'+this.runtime.settings.playerId+'" is mis-configured with multiple ad plugins.')}this.videojs=i;this.util=W;i.bc_=W;this.detectRuntimeEnvironment();this.setupGlobalEnv();W.perf.mark("bcAdBlockDetectStart");Yt().then(function(e){W.perf.mark("bcAdBlockDetectEnd");W.perf.measure("bcAdBlockDetect","bcAdBlockDetectStart","bcAdBlockDetectEnd")})}getRuntime(e){return this.videojs.obj.merge(this.runtime,{settings:e})}getAutoplayConditions(t="video"){const{environment:i}=this.runtime;if(!i.autoplay){i.autoplay={}}return Je(t,this.videojs).then(e=>{i.autoplay[t]=e;return e})}detectRuntimeEnvironment(){const{dom:e}=this.videojs;const{environment:t}=this.runtime;const i=e.hasClass(Ny.documentElement,"bc-iframe");const s=W.qs();t.usingRequireJs=W.isFn(Ly.define)&&Ly.define.amd&&W.isFn(Ly.require&&Ly.require.toUrl);t.isInAnyFrame=e.isInFrame();t.isInBcFrame=i;t.queryString=i?s.search:{};t.urlHash=i?s.hash:{};this.setScriptUrl();this.setScriptBaseUrl()}setScriptUrl(){const{environment:e}=this.runtime;if(e.isInBcFrame){e.scriptUrl=""}else if(e.usingRequireJs){e.scriptUrl=Ly.require.toUrl("bc")}else if(Ny.currentScript){e.scriptUrl=Ny.currentScript.src}else{const t=Ny.getElementsByTagName("script");e.scriptUrl=t.length&&t[t.length-1].src||""}}setScriptBaseUrl(){const{environment:e}=this.runtime;if(e.scriptUrl){e.scriptBaseUrl=e.scriptUrl.split("/").slice(0,-1).join("/")}else{e.scriptBaseUrl="."}}safeSetGlobal(e,t){if(!W.isNil(Ly[e])){return this.videojs.log.warn("setting window."+e+" would overwrite an existing global, skipping")}Ly[e]=t}setupGlobalEnv(){const{videojs:e}=this;const{environment:t}=this.runtime;const{queryStringToWindow:i}=t;if(!i||!t.isInBcFrame){return}const s=e.obj.merge(t.queryString);if(i.target){this.safeSetGlobal(i.target,s)}if(Array.isArray(i.globals)){i.globals.forEach(e=>{this.safeSetGlobal(e,s[e])})}}createInitializer(e,t){const{videojs:i}=this;const{bc:s}=Ly;const{embedId:n,playerId:r,skin:a,version:o}=this.runtime.settings;const l=rc(this,e,t);l.SKIN=a;l.VERSION=o;l.videojs=i;l[`${r}_${n}`]=l;if(s){Object.keys(s).forEach(e=>{const t=s[e];if(typeof t==="function"&&typeof t.videojs==="function"){l[e]=t;delete s[e]}})}Object.defineProperty(l,"usingAdBlocker",{enumerable:true,value:Yt});Object.defineProperty(l,"getAutoplayConditions",{enumerable:true,value:e=>this.getAutoplayConditions(e)});Ly.bc=l;return l}static dedupeVideojs(t,e){let i=t;S.shared.firstVideojs=e||t;if(e&&e.VERSION===t.VERSION){i=e}else if(Ly.bc){const s=Object.keys(Ly.bc);for(let e=0;e<s.length;e++){const n=s[e];const r=Ly.bc[n];if(typeof r==="function"&&typeof r.videojs==="function"){if(r.videojs.VERSION===t.VERSION){i=r.videojs;break}}}}Ly.videojs=i;S.shared.videojs=i;return i}static restoreFirstVideojs(){Ly.videojs=S.shared.firstVideojs}}S.defaultSettings=ac;S.shared={};S.VERSION=D;S.dedupeVideojs=S.dedupeVideojs.bind(null,v);return S}();var n=s.dedupeVideojs(t);var r=new s({accountId:"665001591001",adConfigId:"",autoplay:"",css:{},embedId:"default",media:{poster:{}},plugins:[{name:"perSourceBehaviors",autoInit:true},{name:"errors",autoInit:true,options:{}},{name:"interactivityViewer",autoInit:true,options:{mobilefullscreen:true}}],contextMenu:{},playerId:"bUZeiKlfu",videoCloud:{policyKey:"BCpkADawqM1fMmnU9S7tT6-t3gXQw9Eg5GhseFKiEY1PJzrYQb2LIkcpEZpTjZLhgDTwF4ndYONJQs1Tpd9VdOeZekDCXmd_GCkYNxZMYaqCbVzwuc0y-VfmR7eBVQNJxtc4jtf56frNosuQEouLuhjXmg0Ikq7CXGtCdg"},playerName:"Interactivity Player",skin:"sapphire",responsive:true,liveui:true,controlBar:{},viewability:{},version:"7.24.0"},{});(function(){if(n.getPlugin("perSourceBehaviors")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsPerSourceBehaviors=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);var a="3.0.1";const o=i["default"].getTech("Html5");const s=i["default"].registerPlugin||i["default"].plugin;const l=["abort","emptied","loadstart","play"];const c=["abort","emptied"];const n=["ad-playback","ads-ready?","postroll?","preroll?"];const r=e=>n.indexOf(e)>-1;const u=e=>e.usingPlugin("ads")&&typeof e.ads.inAdBreak==="function";const d=(e,t)=>{if(!e.usingPlugin("ads")){return false}if(u(e)){return e.ads.isInAdMode()&&t.type!=="loadstart"}return r(e.ads.state)};let h=0;const f=function(){const u=[];let s;let t=false;let n;let r=true;const e=c=>{return function(e,t){if(this.perSourceBehaviors.disabled()){return}const i=arguments.length===2;const s=this.currentSrc();const n=[e];const r=arguments[arguments.length-1];const a=i?this:e;const o=r.bind(a);const l=(...e)=>{const t=this.currentSrc()!==s;if(this.perSourceBehaviors.disabled()){return}if(t||c){this.off(...n)}if(!t){o(...e)}};l.guid=o.guid=r.guid=`psb-${++h}`;if(!i){n.push(t)}n.push(l);u.push(n);return this.on(...n)}};this.perSourceBehaviors={disable:function e(){this.clearTimeout(n);n=null;t=true;return t}.bind(this),disabled(){return t},enable(){t=false;return t},enabled(){return!t},isSrcStable(){return r},VERSION:a};this.onPerSrc=e();this.onePerSrc=e(true);this.on("dispose",()=>{u.length=0});this.on(l,e=>{if(this.perSourceBehaviors.disabled()||n||d(this,e)){return}if(r&&c.indexOf(e.type)>-1){r=false;this.trigger("sourceunstable")}const t=[];const i=e=>t.push({time:Date.now(),event:e});i(e);this.on(o.Events,i);n=this.setTimeout(()=>{const e=this.currentSrc();r=true;n=null;this.off(o.Events,i);if(e&&e!==s){u.forEach(e=>this.off(...e));u.length=0;this.trigger("sourcechanged",{interimEvents:t,from:s,to:e});s=e}},1)})};f.VERSION=a;s("perSourceBehaviors",f);return f})})();(function(){if(n.getPlugin("errors")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsErrors=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);var m="6.2.0";const g=i["default"].obj&&i["default"].obj.merge||i["default"].mergeOptions;const s=!i["default"].browser.IS_IPHONE;const y={header:"",code:"",message:"",timeout:45*1e3,backgroundTimeout:300*1e3,dismiss:s,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are "+"connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how "+"to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"}}};const _=function(h,f){let i;let s;let n;const r=[];const t=function(e){f.errors=g(f.errors,e);Object.keys(f.errors).forEach(e=>{const t=f.errors[e];if(!t.type){t.type=e}})};t();const a=function(){if(h.error()&&h.error().code===-2){h.error(null)}h.clearTimeout(s);h.clearTimeout(i);if(n){n=false;h.removeClass("vjs-waiting")}const e=[Infinity,-1];const t=(e,t)=>e.indexOf(t)!==-1;if(Ny.visibilityState==="hidden"&&(h.muted()||t(e,f.backgroundTimeout))||Ny.visibilityState==="visible"&&t(e,f.timeout)){return}s=h.setTimeout(function(){if(h.error()||h.paused()||h.ended()){return}n=true;h.addClass("vjs-waiting")},1e3);i=h.setTimeout(function(){if(h.error()||h.paused()||h.ended()){return}h.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},Ny.visibilityState==="hidden"?f.backgroundTimeout:f.timeout)};const e=function(){let e;while(r.length){e=r.shift();h.off(e[0],e[1])}h.clearTimeout(i);h.clearTimeout(s)};const o=function(e,t){const i=function(){if(!h.error()){if(h.paused()){return a()}if(h.ended()){return a()}}t.call(this)};h.on(e,i);r.push([e,i])};const p=function(){let t=0;e();a();o(["timeupdate","adtimeupdate"],function(){const e=h.currentTime();if(e!==t){t=e;a()}});h.off(Ny,"visibilitychange",p);h.on(Ny,"visibilitychange",p)};const l=function(){if(!h.currentSrc()){h.error({code:-1,type:"PLAYER_ERR_NO_SRC"})}};const c=function(){let e="";let t=h.error();const i=Ny.createElement("div");let s="";if(!t){return}h.off(Ny,"visibilitychange",p);t=g(t,f.errors[t.code||t.type||0]);if(t.message){e=`<div class="vjs-errors-details">${h.localize("Technical details")} : <div class="vjs-errors-message">${h.localize(t.message)}</div> </div>`}const n=h.getChild("errorDisplay");i.className="vjs-errors-dialog";const r=`<div class="vjs-errors-code"><b>${this.localize("Error Code")}:</b> ${t.type||t.code}</div>`;const a=t.code===-2;s=`<div class="vjs-errors-content-container"> <h2 class="vjs-errors-headline">${this.localize(t.headline)}</h2> ${a?"":r} ${a?"":e} </div>`;const o=n.closeable(!("dismiss"in t)||t.dismiss);if(a){s+=`<div class="vjs-errors-timeout-button-container"> <button>${this.localize("Reload Video")}</button> <button>${this.localize("Dismiss")}</button> </div>`;i.innerHTML=s;n.fillWith(i);n.getChild("closeButton").hide();const l=n.el().querySelector(".vjs-errors-timeout-button-container > button:first-child");const c=n.el().querySelector(".vjs-errors-timeout-button-container > button:last-child");const u=()=>{const e=h.currentSource();h.reset();h.src(e)};h.on(l,"click",u);n.one("modalclose",()=>{h.off(l,"click",u);h.off(c,"click",n.close)})}else if(o){s+=`<div class="vjs-errors-ok-button-container"> <button class="vjs-errors-ok-button">${this.localize("OK")}</button> </div>`;i.innerHTML=s;n.fillWith(i);n.contentEl().firstChild.appendChild(n.getChild("closeButton").el());const d=n.el().querySelector(".vjs-errors-ok-button");h.on(d,"click",function(){n.close()})}else{i.innerHTML=s;n.fillWith(i)}if(h.currentWidth()<=600||h.currentHeight()<=250){n.addClass("vjs-xs")}n.one("modalclose",()=>h.error(null))};const u=function(){e();h.removeClass("vjs-errors");h.off("play",p);h.off(Ny,"visibilitychange",p);h.off("play",l);h.off("dispose",u);h.off(["aderror","error"],c)};const d=function(e){u();_(h,g(y,e))};d.extend=e=>t(e);d.getAll=()=>g(f.errors);d.timeout=function(e){if(typeof e==="undefined"){return f.timeout}if(e!==f.timeout){f.timeout=e;if(!h.paused()){p()}}};d.backgroundTimeout=function(e){if(typeof e==="undefined"){return f.backgroundTimeout}if(e!==f.backgroundTimeout){f.backgroundTimeout=e;if(!h.paused()){p()}}};d.disableProgress=()=>{};h.on("play",p);h.on("play",l);h.on("dispose",u);h.on(["aderror","contenterror","error"],c);h.ready(()=>{h.addClass("vjs-errors")});if(!h.paused()){p()}d.VERSION=m;h.errors=d};const n=function(e){_(this,g(y,e))};["extend","getAll"].forEach(e=>{n[e]=function(){i["default"].log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}});n.VERSION=m;i["default"].registerPlugin("errors",n);return n})})();(function(){if(n.getPlugin("interactivityViewer")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsInteractivityViewer=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var u=t(e);var i="2.4.1";const s={viewerApi:{qa:"https://interactivity.viewer.api.qa.brightcove.com",stage:"https://interactivity.viewer.api.stage.brightcove.com",prod:"https://interactivity.viewer.api.brightcove.com"},interactivity:{css:{qa:["https://player.interactivity.qa.brightcove.com/css/generated/player.css","https://player.interactivity.qa.brightcove.com/css/generated/embed.css"],stage:["https://player.interactivity.stage.brightcove.com/css/generated/embed.css","https://player.interactivity.stage.brightcove.com/css/generated/player.css"],prod:["https://player.interactivity.brightcove.com/css/generated/embed.css","https://player.interactivity.brightcove.com/css/generated/player.css"]},script:{qa:"https://player.interactivity.qa.brightcove.com/latest/interactivity.js",stage:"https://player.interactivity.stage.brightcove.com/latest/interactivity.min.js",prod:"https://player.interactivity.brightcove.com/latest/interactivity.min.js"}},playerApi:{qa:"https://interactivity.api.qa.brightcove.com",stage:"https://interactivity.api.stage.brightcove.com",prod:"https://interactivity.api.brightcove.com"}};const n=e=>{const t=Array.from(Ny.querySelectorAll("link")).map(e=>e.href.replace(/^https?:/i,""));const i=e.filter(e=>t.indexOf(e.replace(/^https?:/i,""))===-1);const s=i.map(s=>{return new Promise((e,t)=>{const i=Ny.createElement("link");i.rel="stylesheet";i.type="text/css";i.href=s;i.onload=()=>e(s);i.onerror=()=>t(`css not loaded: ${s}`);Ny.getElementsByTagName("head")[0].append(i)})});return Promise.all(s)};const d=e=>{if(e){switch(e.toLowerCase()){case"qa":return s.viewerApi.qa;case"stage":case"staging":return s.viewerApi.stage}}return s.viewerApi.prod};const h=e=>{if(e){switch(e.toLowerCase()){case"qa":return s.playerApi.qa;case"stage":case"staging":return s.playerApi.stage}}return s.playerApi.prod};const r=e=>{if(e){switch(e.toLowerCase()){case"qa":return s.interactivity.script.qa;case"stage":case"staging":return s.interactivity.script.stage}}return s.interactivity.script.prod};const a=e=>{if(e){switch(e.toLowerCase()){case"qa":return s.interactivity.css.qa;case"stage":case"staging":return s.interactivity.css.stage}}return s.interactivity.css.prod};const f=e=>{const t=e.options_;const i=t.runtime_.environment.queryString;const s=t.runtime_.environment.isInBcFrame;return s&&i.interactivityProjectId||t&&t["data-interactivity-project-id"]};const p=e=>{if(e.options_&&e.options_.runtime_&&e.options_.runtime_.settings&&e.options_.runtime_.settings.media&&e.options_.runtime_.settings.media.height){u["default"].log.debug(`player size from player.options_.runtime_.settings.media ${e.options_.runtime_.settings.media}`);return{height:e.options_.runtime_.settings.media.height,width:e.options_.runtime_.settings.media.width}}if(e.height_){u["default"].log.debug(`player size from player ${e.options_.runtime_.settings.media}`);return{height:e.height_,width:e.width_}}u["default"].log.debug("player size not found");return{height:undefined,width:undefined}};const m=function(e){const t=e.options_;const i=t.runtime_.environment.queryString;const s=t.runtime_.environment.isInBcFrame;const n=s&&i.userId||t&&t["data-interactivity-user-id"];const r=s&&i.username||t&&t["data-interactivity-username"];return{id:n,username:r}};const g=function(e){const t=e.options_.runtime_.settings;return t.videoCloud&&t.videoCloud.bumper};const o=e=>{const{env:t}=e;const s=r(t);if(Ly.hapyak||Ly.interactivity){u["default"].log("lib already loaded...");return Promise.resolve()}const i=Ny.getElementById("interactivity-lib");if(i){return new Promise((e,t)=>{u["default"].log("lib not ready yet to use, waiting for it...");i.addEventListener("load",()=>{e()});i.addEventListener("error",()=>{t(new Error("wait for lib took too much or failed"))})})}return new Promise((e,t)=>{const i=Ny.createElement("script");i.id="interactivity-lib";i.src=s;i.async=true;i.onload=()=>e(s);i.onerror=()=>t(new URIError(`script failed to load: ${s}`));Ny.getElementsByTagName("head")[0].append(i);u["default"].log("lib started to load")})};const y=(e,t)=>{let i="";const s=["trace","metrics","debug","info","warn","error"];const n=e.options_.runtime_.environment.queryString.interactivityLogLevel;const r=e.options_.runtime_.environment.queryString.interactivityDebug==="true";if(r){i="debug"}else{i=s.includes(n)?n:t}return i};const _=function(e,t){const i=e.bcinfo.accountId;const s=`${d(t)}/api/accounts/${i}/projects/`;const n=e.mediainfo;const r={title:n.name,video_id:n.id,tags:n.tags};const a={method:"POST",json:true,body:r,headers:{"Content-Type":"application/json"},url:s};return new Promise((s,n)=>{u["default"].xhr(a,(e,t,i)=>{if(e){n(new Error(e))}if(t.statusCode>=400){n(t)}if(t.statusCode>=200&&t.statusCode<300){s(i.result.data)}})})};const l=function(a,o){const t=[];const e=a.getAccountId();let i=false;let s=a.mediainfo.id||null;const l=f(a);let n=d(o.env);const r=g(a);if(r&&a.catalog&&a.catalog.isCurrentSourceBumper()){u["default"].log("Bumper is present and will be used to fetch annotations data");s=r.id;i=true}if(!l&&!s){u["default"].log.debug("interactivityViewer: avoid load project data, there is no videoId or projectId information");return Promise.reject("no projectId or videoId given")}if(l&&!i){n+=`/api/accounts/${e}/projects/${l}`}else{n+=`/api/accounts/${e}/projects`;t.push(`video_id=${s}`)}if(Array.isArray(o.apply_template_tags)){o.apply_template_tags.forEach(e=>t.push(`apply_template_tags[]=${encodeURIComponent(e)}`))}if(t.length>0){n+="?"+t.join("&")}const c={method:"GET",json:true,url:n};return new Promise((n,r)=>{u["default"].xhr(c,(e,t,i)=>{if(e){r(new Error(e))}const s=o.create&&!l;if(t.statusCode===404&&s){_(a,o.env).then(e=>{n(e)}).catch(e=>{r(e)})}else if(t.statusCode===404){r(t)}if(t.statusCode>=400&&t.statusCode!==404){r(t)}if(t.statusCode>=200&&t.statusCode<300){n(i.result.data)}})})};function c(t,e){if(t.event.indexOf("Annotation")===-1){return}if(e.audience==="undefined"){return}Ly.interactivityMetricsSummary=Ly.interactivityMetricsSummary||[];const i=Ly.interactivityMetricsSummary["vid_"+e.mediainfo.id]||{"link-actions":0,"chapter-actions":0,chapters:[],"response-actions":0,questions:[]};const s={"link-actions":{slot:"metric1",type:"number"},"chapter-actions":{slot:"metric2",type:"number"},chapters:{slot:"event2",type:"string"},"response-actions":{slot:"metric3",type:"number"},questions:{slot:"event3",type:"string"}};const n=["hotlink","pop","image"];const r=["hotlink","pop","image","contents","bookmark"];const a=["quiz","response","iframe"];const o=function(t,i){for(let e=0;e<i.length;e++){if(t===i[e]){return true}}return false};const l=function(e){const t=parseInt(e,10);let i=Math.floor(t/3600);let s=Math.floor((t-i*3600)/60);let n=t-i*3600-s*60;if(i<10){i="0"+i}if(s<10){s="0"+s}if(n<10){n="0"+n}return s+":"+n};const c=t.properties["Annotation Type"];const u=function(){if(o(c,n)){if(t.properties.Target){return true}}};const d=function(){if(o(c,r)){if(c==="contents"||c==="bookmark"||!isNaN(parseInt(t.properties["Target Time"]))){return true}}return false};const h=function(){if(o(c,a)){if(t.properties.Action==="Response-Poll"||t.properties.Action==="Submit"){return true}}return false};const f=function(){const e={};if(t.properties.Text){e.text=t.properties.Text}if(t.properties.prompt){e.text=t.properties.prompt}if(c==="contents"){e.text="chapter menu"}if(t.properties.Target){e.href=t.properties.Target}if(t.properties["Target Time"]){e.seek=t.properties["Target Time"]}else{e.seek=t.properties["Annotation Start Time"]}e.seek=l(e.seek);return e};const p=function(){if(d()&&!t.properties["Target Time"]){return false}if(d()||h()||u()){return true}return false};let m=false;if(t.event==="Annotation View"&&d()){m=true;i.chapters.push(f().text+"("+f().seek+")");e.audience.track(s.chapters.slot,i.chapters.join(", "))}else if(t.event==="Annotation Action"&&p()){m=true;if(d()){i["chapter-actions"]=i["chapter-actions"]+1;e.audience.track(s["chapter-actions"].slot,i["chapter-actions"])}if(u()){i["link-actions"]=i["link-actions"]+1;e.audience.track(s["link-actions"].slot,i["link-actions"])}if(h()){i["response-actions"]=i["response-actions"]+1;e.audience.track(s["response-actions"].slot,i["response-actions"]);if(t.properties.Action==="Submit"&&Object.prototype.toString.call(t.properties.Summary)==="[object Array]"){for(let e=0;e<t.properties.Summary.length;e++){const g=t.properties.Summary[e];i.questions.push(g.question+"("+f().seek+")")}e.audience.track(s.questions.slot,i.questions.join(", "))}}}if(m){console.log("Mapped Data",i);Ly.interactivityMetricsSummary["vid_"+e.mediainfo.id]=i}console.log("Interactivity Event / "+t.event,t.properties)}const v=u["default"].getPlugin("plugin");const b={controls:false,logLevel:"error",playerParameters:{},returnPlayerDOM:true,unpacked:true,version:20220818,create:false,campaignTrack:true};class T extends v{constructor(e,t){super(e);this.options=u["default"].mergeOptions(b,t);let i;if(this.player.catalog){i=this.player.catalog.getCatalogParamDefault_("env")}i=i?i.toLowerCase():"production";this.options.env=i;this.loadCss();this.loadLib();this.player.addClass("vjs-interactivity-viewer");this._loadedMetadataFired=false;this._scriptLoaded=false;this.player.on("loadedmetadata",()=>{this._loadedMetadataFired=true;this.initIfReady()});this.initIfReady()}loadCss(){const e=a(this.options.env);n(e).then(this.log("Stylesheet files loaded")).catch(this.log.error)}loadLib(){o(this.options).then(()=>{this.log("lib loaded and ready to use.");this._scriptLoaded=true;this.initIfReady()}).catch(this.log.error)}initIfReady(){this.interactivityCleanup();if(this._scriptLoaded&&this._loadedMetadataFired){l(this.player,this.options).then(e=>{this.interactivityCleanup();this.interactivityInit(e)}).catch(this.log.error)}}interactivityCleanup(){const e=this.player.interactivityViewerInstance;if(e){e.resetVariables();e.destroy()}}interactivityInit(e){const t=this.options;const i=e.bc_account_id;const s=e.video_id;const n={type:"Project",data:{id:e.id,title:e.title,tags:e.tags,css:e.css_url,keepAnnotationAspectRatio:true}};const r={type:"Video",data:{id:s,source:"brightcove-v2",source_id:s}};const a={type:"Track",data:{id:e.id}};const o=(e.annotations||[]).concat(e.template_annotations||[]);const l={type:"Comment",data:o.map(e=>({id:e.id,start_time:e.start_time.value,start_time_format:e.start_time.units,duration:e.duration.value,duration_format:e.duration.units,properties:{popcorn:e.properties.popcorn,html:e.properties.html},custom_configuration:e.properties.custom_configuration,type:e.type}))};const c=p(this.player);t.accountId=i;t.dataURI=`${h(this.options.env)}/v1/accounts/${i}/projects/`;t.loadData=[n,r,a,l];t.height=c.height;t.width=c.width;t.projectId=e.id;t.trackId=e.id;t.videoId=s;t.viewerDataURI=d(this.options.env);t.player=this.player;t.playerParameters.accountId=i;t.playerParameters.bcEmbed=this.player.bcinfo.embedId;t.playerParameters.bcPlayer=this.player.bcinfo.playerId;t.environment=this.options.env;t.editor=false;t.resetVariables=!e.show_questions_once;t.user=m(this.player);t.logLevel=y(this.player,t.logLevel);t.onload=e=>{this.player.interactivityViewerInstance=e;e.resetVariables()};if(this.player.bcMapPlugin!==undefined&&this.options.campaignTrack){t.onTrackingEvent=e=>this.onTrackingEvent(e)}if(this.options.env&&this.options.env==="qa"){t.playerParameters.bcURL="https://bc-players-qa.s3.amazonaws.com"}Ly.hapyak.viewer(t)}onTrackingEvent(e){c(e,this.player)}setData(e={}){this.options=u["default"].mergeOptions(this.options,e)}}T.defaultState={};T.VERSION=i;u["default"].registerPlugin("interactivityViewer",T);return T})})();var a=r.createInitializer();s.restoreFirstVideojs();return a}(window,document)}catch(e){t=null;console.error("Unable to initialize Brightcove Player. ",e)}if(t===null||e(t.videojs.browser)){var i=function e(t,i,s){var n,r,a,o,l,c,u,d,h;n=document.createElement("div");r=document.createElement("div");r.setAttribute("style","min-height:10em;display:table-cell;vertical-align:middle;text-align:center;font-family:proxima-nova,sans-serif;color:#fff");n.appendChild(r);a=document.createElement("div");a.setAttribute("style","font-size:32px;margin-bottom:10px");a.innerHTML="Oops! There seems to be a problem...";r.appendChild(a);o=document.createElement("div");o.setAttribute("style","font-size:24px");if(s){o.innerHTML="This browser is not compatible with the Brightcove Player."}else{o.innerHTML="The player has been deactivated by the content owner."}r.appendChild(o);c=[].concat(Array.prototype.slice.call(document.querySelectorAll("video")),Array.prototype.slice.call(document.querySelectorAll("video-js")));for(h=0;h<c.length;h++){u=c[h];if(u.getAttribute("data-player")===t&&u.getAttribute("data-embed")===i){var f,p;l=u.parentElement;p=window.getComputedStyle(l).height;f=window.getComputedStyle(l).width;d="background:#414141;background:-moz-linear-gradient(top,#414141 0,grey 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#414141),color-stop(100%,grey));background:-webkit-linear-gradient(top,#414141 0,grey 100%);background:-o-linear-gradient(top,#414141 0,grey 100%);background:-ms-linear-gradient(top,#414141 0,grey 100%);background:linear-gradient(to bottom,#414141 0,grey 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#414141', endColorstr='#808080', GradientType=0 );display:table;margin:0;padding:0";d+=";width:"+f+";";d+="height:"+p;n.setAttribute("style",d);l.insertBefore(n,u);l.removeChild(u)}}};var s="bUZeiKlfu";var n="default";i(s,n,true);return}t(document.querySelector("video-js"))})();;</script> <script>(function(p){p.mark&&p.mark('bcParseEnd');p.measure&&p.measure('bcParse','bcParseStart','bcParseEnd')})(window.performance||{})</script> </body></html>