@content-blocks/js 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/dist/cjs/BehaviorSubject-771fd78b.js +640 -0
- package/dist/cjs/BehaviorSubject-771fd78b.js.map +1 -0
- package/dist/cjs/Youtube-41424972.js +807 -0
- package/dist/cjs/Youtube-41424972.js.map +1 -0
- package/dist/cjs/content-accordion.cjs.entry.js +114 -0
- package/dist/cjs/content-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/content-blocks.cjs.js +25 -0
- package/dist/cjs/content-blocks.cjs.js.map +1 -0
- package/dist/cjs/content-button_4.cjs.entry.js +2165 -0
- package/dist/cjs/content-button_4.cjs.entry.js.map +1 -0
- package/dist/cjs/content-carousel-8b0e8962.js +1488 -0
- package/dist/cjs/content-carousel-8b0e8962.js.map +1 -0
- package/dist/cjs/content-carousel.cjs.entry.js +13 -0
- package/dist/cjs/content-carousel.cjs.entry.js.map +1 -0
- package/dist/cjs/content-grid-formatter.cjs.entry.js +50 -0
- package/dist/cjs/content-grid-formatter.cjs.entry.js.map +1 -0
- package/dist/cjs/content-hero-block.cjs.entry.js +46 -0
- package/dist/cjs/content-hero-block.cjs.entry.js.map +1 -0
- package/dist/cjs/content-image.cjs.entry.js +95 -0
- package/dist/cjs/content-image.cjs.entry.js.map +1 -0
- package/dist/cjs/content-navigation-block.cjs.entry.js +62 -0
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -0
- package/dist/cjs/content-split-block.cjs.entry.js +36 -0
- package/dist/cjs/content-split-block.cjs.entry.js.map +1 -0
- package/dist/cjs/content-tabs.cjs.entry.js +219 -0
- package/dist/cjs/content-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/content-text-block.cjs.entry.js +48 -0
- package/dist/cjs/content-text-block.cjs.entry.js.map +1 -0
- package/dist/cjs/content-tout-block.cjs.entry.js +32 -0
- package/dist/cjs/content-tout-block.cjs.entry.js.map +1 -0
- package/dist/cjs/content-video.cjs.entry.js +114 -0
- package/dist/cjs/content-video.cjs.entry.js.map +1 -0
- package/dist/cjs/index-a42fb1d0.js +2116 -0
- package/dist/cjs/index-a42fb1d0.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/swiper-8c9ab198.js +3612 -0
- package/dist/cjs/swiper-8c9ab198.js.map +1 -0
- package/dist/cjs/utils-6c985f2f.js +113 -0
- package/dist/cjs/utils-6c985f2f.js.map +1 -0
- package/dist/cjs/video.es-7d4d33f5.js +64206 -0
- package/dist/cjs/video.es-7d4d33f5.js.map +1 -0
- package/dist/cjs/window-resize-service-c9766178.js +35 -0
- package/dist/cjs/window-resize-service-c9766178.js.map +1 -0
- package/dist/collection/blocks/content-hero-block/content-hero-block.css +39 -0
- package/dist/collection/blocks/content-hero-block/content-hero-block.js +138 -0
- package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +1 -0
- package/dist/collection/blocks/content-hero-block/test/content-hero-block.e2e.js +10 -0
- package/dist/collection/blocks/content-hero-block/test/content-hero-block.e2e.js.map +1 -0
- package/dist/collection/blocks/content-hero-block/test/content-hero-block.spec.js +18 -0
- package/dist/collection/blocks/content-hero-block/test/content-hero-block.spec.js.map +1 -0
- package/dist/collection/blocks/content-split-block/content-split-block.css +18 -0
- package/dist/collection/blocks/content-split-block/content-split-block.js +125 -0
- package/dist/collection/blocks/content-split-block/content-split-block.js.map +1 -0
- package/dist/collection/blocks/content-split-block/test/content-split-block.e2e.js +10 -0
- package/dist/collection/blocks/content-split-block/test/content-split-block.e2e.js.map +1 -0
- package/dist/collection/blocks/content-split-block/test/content-split-block.spec.js +18 -0
- package/dist/collection/blocks/content-split-block/test/content-split-block.spec.js.map +1 -0
- package/dist/collection/blocks/content-text-block/content-text-block.css +47 -0
- package/dist/collection/blocks/content-text-block/content-text-block.js +192 -0
- package/dist/collection/blocks/content-text-block/content-text-block.js.map +1 -0
- package/dist/collection/blocks/content-text-block/test/content-text-block.e2e.js +10 -0
- package/dist/collection/blocks/content-text-block/test/content-text-block.e2e.js.map +1 -0
- package/dist/collection/blocks/content-text-block/test/content-text-block.spec.js +18 -0
- package/dist/collection/blocks/content-text-block/test/content-text-block.spec.js.map +1 -0
- package/dist/collection/blocks/content-tout-block/content-tout-block.css +35 -0
- package/dist/collection/blocks/content-tout-block/content-tout-block.js +74 -0
- package/dist/collection/blocks/content-tout-block/content-tout-block.js.map +1 -0
- package/dist/collection/blocks/content-tout-block/test/content-tout-block.e2e.js +10 -0
- package/dist/collection/blocks/content-tout-block/test/content-tout-block.e2e.js.map +1 -0
- package/dist/collection/blocks/content-tout-block/test/content-tout-block.spec.js +18 -0
- package/dist/collection/blocks/content-tout-block/test/content-tout-block.spec.js.map +1 -0
- package/dist/collection/collection-manifest.json +27 -0
- package/dist/collection/components/content-accordion/content-accordion.css +11 -0
- package/dist/collection/components/content-accordion/content-accordion.js +33 -0
- package/dist/collection/components/content-accordion/content-accordion.js.map +1 -0
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js +87 -0
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js.map +1 -0
- package/dist/collection/components/content-accordion/test/content-accordion.e2e.js +10 -0
- package/dist/collection/components/content-accordion/test/content-accordion.e2e.js.map +1 -0
- package/dist/collection/components/content-accordion/test/content-accordion.spec.js +18 -0
- package/dist/collection/components/content-accordion/test/content-accordion.spec.js.map +1 -0
- package/dist/collection/components/content-carousel/content-carousel.css +21 -0
- package/dist/collection/components/content-carousel/content-carousel.js +152 -0
- package/dist/collection/components/content-carousel/content-carousel.js.map +1 -0
- package/dist/collection/components/content-carousel/test/content-carousel.e2e.js +10 -0
- package/dist/collection/components/content-carousel/test/content-carousel.e2e.js.map +1 -0
- package/dist/collection/components/content-carousel/test/content-carousel.spec.js +18 -0
- package/dist/collection/components/content-carousel/test/content-carousel.spec.js.map +1 -0
- package/dist/collection/components/content-navigation-block/content-navigation-block.css +51 -0
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +146 -0
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -0
- package/dist/collection/components/content-navigation-block/test/content-navigation-block.e2e.js +10 -0
- package/dist/collection/components/content-navigation-block/test/content-navigation-block.e2e.js.map +1 -0
- package/dist/collection/components/content-navigation-block/test/content-navigation-block.spec.js +18 -0
- package/dist/collection/components/content-navigation-block/test/content-navigation-block.spec.js.map +1 -0
- package/dist/collection/components/content-overlay/content-overlay.css +103 -0
- package/dist/collection/components/content-overlay/content-overlay.js +384 -0
- package/dist/collection/components/content-overlay/content-overlay.js.map +1 -0
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js +356 -0
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js.map +1 -0
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js +78 -0
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js.map +1 -0
- package/dist/collection/components/content-overlay/test/content-overlay.e2e.js +10 -0
- package/dist/collection/components/content-overlay/test/content-overlay.e2e.js.map +1 -0
- package/dist/collection/components/content-overlay/test/content-overlay.spec.js +18 -0
- package/dist/collection/components/content-overlay/test/content-overlay.spec.js.map +1 -0
- package/dist/collection/components/content-tabs/content-tabs.css +19 -0
- package/dist/collection/components/content-tabs/content-tabs.js +27 -0
- package/dist/collection/components/content-tabs/content-tabs.js.map +1 -0
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js +223 -0
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js.map +1 -0
- package/dist/collection/components/content-tabs/test/content-tabs.e2e.js +10 -0
- package/dist/collection/components/content-tabs/test/content-tabs.e2e.js.map +1 -0
- package/dist/collection/components/content-tabs/test/content-tabs.spec.js +18 -0
- package/dist/collection/components/content-tabs/test/content-tabs.spec.js.map +1 -0
- package/dist/collection/elements/content-button/content-button.css +37 -0
- package/dist/collection/elements/content-button/content-button.js +257 -0
- package/dist/collection/elements/content-button/content-button.js.map +1 -0
- package/dist/collection/elements/content-button/test/content-button.e2e.js +10 -0
- package/dist/collection/elements/content-button/test/content-button.e2e.js.map +1 -0
- package/dist/collection/elements/content-button/test/content-button.spec.js +18 -0
- package/dist/collection/elements/content-button/test/content-button.spec.js.map +1 -0
- package/dist/collection/elements/content-image/content-image.css +53 -0
- package/dist/collection/elements/content-image/content-image.js +305 -0
- package/dist/collection/elements/content-image/content-image.js.map +1 -0
- package/dist/collection/elements/content-image/test/content-image.e2e.js +10 -0
- package/dist/collection/elements/content-image/test/content-image.e2e.js.map +1 -0
- package/dist/collection/elements/content-image/test/content-image.spec.js +18 -0
- package/dist/collection/elements/content-image/test/content-image.spec.js.map +1 -0
- package/dist/collection/elements/content-line/content-line.css +18 -0
- package/dist/collection/elements/content-line/content-line.e2e.js +10 -0
- package/dist/collection/elements/content-line/content-line.e2e.js.map +1 -0
- package/dist/collection/elements/content-line/content-line.js +229 -0
- package/dist/collection/elements/content-line/content-line.js.map +1 -0
- package/dist/collection/elements/content-video/content-video.css +75 -0
- package/dist/collection/elements/content-video/content-video.js +391 -0
- package/dist/collection/elements/content-video/content-video.js.map +1 -0
- package/dist/collection/elements/content-video/test/content-video.e2e.js +10 -0
- package/dist/collection/elements/content-video/test/content-video.e2e.js.map +1 -0
- package/dist/collection/elements/content-video/test/content-video.spec.js +18 -0
- package/dist/collection/elements/content-video/test/content-video.spec.js.map +1 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +43 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +269 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -0
- package/dist/collection/formatters/content-grid-formatter/test/content-grid-formatter.e2e.js +10 -0
- package/dist/collection/formatters/content-grid-formatter/test/content-grid-formatter.e2e.js.map +1 -0
- package/dist/collection/formatters/content-grid-formatter/test/content-grid-formatter.spec.js +18 -0
- package/dist/collection/formatters/content-grid-formatter/test/content-grid-formatter.spec.js.map +1 -0
- package/dist/collection/formatters/content-spacer/content-spacer.css +32 -0
- package/dist/collection/formatters/content-spacer/content-spacer.js +350 -0
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -0
- package/dist/collection/formatters/content-spacer/test/content-spacer.e2e.js +10 -0
- package/dist/collection/formatters/content-spacer/test/content-spacer.e2e.js.map +1 -0
- package/dist/collection/formatters/content-spacer/test/content-spacer.spec.js +18 -0
- package/dist/collection/formatters/content-spacer/test/content-spacer.spec.js.map +1 -0
- package/dist/collection/globalScript.js +15 -0
- package/dist/collection/globalScript.js.map +1 -0
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/sass/_mixins.scss +249 -0
- package/dist/collection/sass/_variables.scss +18 -0
- package/dist/collection/services/content-events-service.js +23 -0
- package/dist/collection/services/content-events-service.js.map +1 -0
- package/dist/collection/services/window-resize-service.js +29 -0
- package/dist/collection/services/window-resize-service.js.map +1 -0
- package/dist/collection/utils/utils.js +88 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/collection/utils/utils.spec.js +1 -0
- package/dist/collection/utils/utils.spec.js.map +1 -0
- package/dist/components/BehaviorSubject.js +637 -0
- package/dist/components/BehaviorSubject.js.map +1 -0
- package/dist/components/Youtube.js +805 -0
- package/dist/components/Youtube.js.map +1 -0
- package/dist/components/content-accordion.d.ts +11 -0
- package/dist/components/content-accordion.js +127 -0
- package/dist/components/content-accordion.js.map +1 -0
- package/dist/components/content-button.d.ts +11 -0
- package/dist/components/content-button.js +88 -0
- package/dist/components/content-button.js.map +1 -0
- package/dist/components/content-carousel.d.ts +11 -0
- package/dist/components/content-carousel.js +1489 -0
- package/dist/components/content-carousel.js.map +1 -0
- package/dist/components/content-grid-formatter.d.ts +11 -0
- package/dist/components/content-grid-formatter.js +8 -0
- package/dist/components/content-grid-formatter.js.map +1 -0
- package/dist/components/content-grid-formatter2.js +68 -0
- package/dist/components/content-grid-formatter2.js.map +1 -0
- package/dist/components/content-hero-block.d.ts +11 -0
- package/dist/components/content-hero-block.js +63 -0
- package/dist/components/content-hero-block.js.map +1 -0
- package/dist/components/content-image.d.ts +11 -0
- package/dist/components/content-image.js +120 -0
- package/dist/components/content-image.js.map +1 -0
- package/dist/components/content-line.d.ts +11 -0
- package/dist/components/content-line.js +70 -0
- package/dist/components/content-line.js.map +1 -0
- package/dist/components/content-navigation-block.d.ts +11 -0
- package/dist/components/content-navigation-block.js +79 -0
- package/dist/components/content-navigation-block.js.map +1 -0
- package/dist/components/content-overlay.d.ts +11 -0
- package/dist/components/content-overlay.js +2048 -0
- package/dist/components/content-overlay.js.map +1 -0
- package/dist/components/content-spacer.d.ts +11 -0
- package/dist/components/content-spacer.js +76 -0
- package/dist/components/content-spacer.js.map +1 -0
- package/dist/components/content-split-block.d.ts +11 -0
- package/dist/components/content-split-block.js +58 -0
- package/dist/components/content-split-block.js.map +1 -0
- package/dist/components/content-tabs.d.ts +11 -0
- package/dist/components/content-tabs.js +232 -0
- package/dist/components/content-tabs.js.map +1 -0
- package/dist/components/content-text-block.d.ts +11 -0
- package/dist/components/content-text-block.js +66 -0
- package/dist/components/content-text-block.js.map +1 -0
- package/dist/components/content-tout-block.d.ts +11 -0
- package/dist/components/content-tout-block.js +46 -0
- package/dist/components/content-tout-block.js.map +1 -0
- package/dist/components/content-video.d.ts +11 -0
- package/dist/components/content-video.js +141 -0
- package/dist/components/content-video.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/swiper.js +3608 -0
- package/dist/components/swiper.js.map +1 -0
- package/dist/components/utils.js +106 -0
- package/dist/components/utils.js.map +1 -0
- package/dist/components/video.es.js +64201 -0
- package/dist/components/video.es.js.map +1 -0
- package/dist/components/window-resize-service.js +33 -0
- package/dist/components/window-resize-service.js.map +1 -0
- package/dist/content-blocks/content-blocks.esm.js +2 -0
- package/dist/content-blocks/content-blocks.esm.js.map +1 -0
- package/dist/content-blocks/index.esm.js +2 -0
- package/dist/content-blocks/index.esm.js.map +1 -0
- package/dist/content-blocks/p-03ca48aa.js +2 -0
- package/dist/content-blocks/p-03ca48aa.js.map +1 -0
- package/dist/content-blocks/p-0ee5bbb6.entry.js +2 -0
- package/dist/content-blocks/p-0ee5bbb6.entry.js.map +1 -0
- package/dist/content-blocks/p-193fa2c0.entry.js +2 -0
- package/dist/content-blocks/p-193fa2c0.entry.js.map +1 -0
- package/dist/content-blocks/p-1b699607.js +2 -0
- package/dist/content-blocks/p-1b699607.js.map +1 -0
- package/dist/content-blocks/p-1efe0577.entry.js +2 -0
- package/dist/content-blocks/p-1efe0577.entry.js.map +1 -0
- package/dist/content-blocks/p-2357f07a.entry.js +2 -0
- package/dist/content-blocks/p-2357f07a.entry.js.map +1 -0
- package/dist/content-blocks/p-363e8357.entry.js +2 -0
- package/dist/content-blocks/p-363e8357.entry.js.map +1 -0
- package/dist/content-blocks/p-36793013.entry.js +10 -0
- package/dist/content-blocks/p-36793013.entry.js.map +1 -0
- package/dist/content-blocks/p-3a170c2c.entry.js +2 -0
- package/dist/content-blocks/p-3a170c2c.entry.js.map +1 -0
- package/dist/content-blocks/p-43a91cc7.js +29 -0
- package/dist/content-blocks/p-43a91cc7.js.map +1 -0
- package/dist/content-blocks/p-6d43a03c.js +2 -0
- package/dist/content-blocks/p-6d43a03c.js.map +1 -0
- package/dist/content-blocks/p-89fb0d8f.js +2 -0
- package/dist/content-blocks/p-89fb0d8f.js.map +1 -0
- package/dist/content-blocks/p-a7dfb547.entry.js +2 -0
- package/dist/content-blocks/p-a7dfb547.entry.js.map +1 -0
- package/dist/content-blocks/p-b27d54cb.entry.js +2 -0
- package/dist/content-blocks/p-b27d54cb.entry.js.map +1 -0
- package/dist/content-blocks/p-bf1cfb7b.js +3 -0
- package/dist/content-blocks/p-bf1cfb7b.js.map +1 -0
- package/dist/content-blocks/p-c5891e59.js +2 -0
- package/dist/content-blocks/p-c5891e59.js.map +1 -0
- package/dist/content-blocks/p-cd552ce2.js +2 -0
- package/dist/content-blocks/p-cd552ce2.js.map +1 -0
- package/dist/content-blocks/p-ce179781.entry.js +2 -0
- package/dist/content-blocks/p-ce179781.entry.js.map +1 -0
- package/dist/content-blocks/p-d3503dde.entry.js +2 -0
- package/dist/content-blocks/p-d3503dde.entry.js.map +1 -0
- package/dist/content-blocks/p-dca7ab2c.entry.js +2 -0
- package/dist/content-blocks/p-dca7ab2c.entry.js.map +1 -0
- package/dist/content-blocks/sass/_mixins.scss +249 -0
- package/dist/content-blocks/sass/_variables.scss +18 -0
- package/dist/esm/BehaviorSubject-bc7e0e99.js +637 -0
- package/dist/esm/BehaviorSubject-bc7e0e99.js.map +1 -0
- package/dist/esm/Youtube-6c271d8d.js +805 -0
- package/dist/esm/Youtube-6c271d8d.js.map +1 -0
- package/dist/esm/content-accordion.entry.js +110 -0
- package/dist/esm/content-accordion.entry.js.map +1 -0
- package/dist/esm/content-blocks.js +20 -0
- package/dist/esm/content-blocks.js.map +1 -0
- package/dist/esm/content-button_4.entry.js +2158 -0
- package/dist/esm/content-button_4.entry.js.map +1 -0
- package/dist/esm/content-carousel-cf7daf22.js +1469 -0
- package/dist/esm/content-carousel-cf7daf22.js.map +1 -0
- package/dist/esm/content-carousel.entry.js +5 -0
- package/dist/esm/content-carousel.entry.js.map +1 -0
- package/dist/esm/content-grid-formatter.entry.js +46 -0
- package/dist/esm/content-grid-formatter.entry.js.map +1 -0
- package/dist/esm/content-hero-block.entry.js +42 -0
- package/dist/esm/content-hero-block.entry.js.map +1 -0
- package/dist/esm/content-image.entry.js +91 -0
- package/dist/esm/content-image.entry.js.map +1 -0
- package/dist/esm/content-navigation-block.entry.js +58 -0
- package/dist/esm/content-navigation-block.entry.js.map +1 -0
- package/dist/esm/content-split-block.entry.js +32 -0
- package/dist/esm/content-split-block.entry.js.map +1 -0
- package/dist/esm/content-tabs.entry.js +215 -0
- package/dist/esm/content-tabs.entry.js.map +1 -0
- package/dist/esm/content-text-block.entry.js +44 -0
- package/dist/esm/content-text-block.entry.js.map +1 -0
- package/dist/esm/content-tout-block.entry.js +28 -0
- package/dist/esm/content-tout-block.entry.js.map +1 -0
- package/dist/esm/content-video.entry.js +110 -0
- package/dist/esm/content-video.entry.js.map +1 -0
- package/dist/esm/index-6701e2ba.js +2087 -0
- package/dist/esm/index-6701e2ba.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/swiper-977c310f.js +3610 -0
- package/dist/esm/swiper-977c310f.js.map +1 -0
- package/dist/esm/utils-27374a56.js +106 -0
- package/dist/esm/utils-27374a56.js.map +1 -0
- package/dist/esm/video.es-e4c3f886.js +64201 -0
- package/dist/esm/video.es-e4c3f886.js.map +1 -0
- package/dist/esm/window-resize-service-8a52f08c.js +33 -0
- package/dist/esm/window-resize-service-8a52f08c.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/blocks/content-hero-block/content-hero-block.d.ts +33 -0
- package/dist/types/blocks/content-split-block/content-split-block.d.ts +27 -0
- package/dist/types/blocks/content-text-block/content-text-block.d.ts +44 -0
- package/dist/types/blocks/content-tout-block/content-tout-block.d.ts +22 -0
- package/dist/types/components/content-accordion/content-accordion.d.ts +12 -0
- package/dist/types/components/content-accordion/libraries/w3_disclosure_button.d.ts +4 -0
- package/dist/types/components/content-carousel/content-carousel.d.ts +36 -0
- package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +31 -0
- package/dist/types/components/content-overlay/content-overlay.d.ts +69 -0
- package/dist/types/components/content-overlay/libraries/aria-dialog.d.ts +5 -0
- package/dist/types/components/content-overlay/libraries/aria-utilities.d.ts +5 -0
- package/dist/types/components/content-tabs/content-tabs.d.ts +10 -0
- package/dist/types/components/content-tabs/libraries/w3_tabs.d.ts +4 -0
- package/dist/types/components.d.ts +994 -0
- package/dist/types/elements/content-button/content-button.d.ts +55 -0
- package/dist/types/elements/content-image/content-image.d.ts +56 -0
- package/dist/types/elements/content-line/content-line.d.ts +56 -0
- package/dist/types/elements/content-video/content-video.d.ts +77 -0
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +52 -0
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +73 -0
- package/dist/types/globalScript.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/services/content-events-service.d.ts +11 -0
- package/dist/types/services/window-resize-service.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1652 -0
- package/dist/types/typings.d.ts +11 -0
- package/dist/types/utils/utils.d.ts +13 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +65 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var t=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}function i(t,e,i){return i={path:e,exports:{},require:function(t,e){return n()}},t(i,i.exports),i.exports}function s(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:true});Object.keys(t).forEach((function(i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:true,get:function(){return t[i]}})}));return e}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var r;if(typeof window!=="undefined"){r=window}else if(typeof t!=="undefined"){r=t}else if(typeof self!=="undefined"){r=self}else{r={}}var o=r;const a={};const h=Object.freeze({__proto__:null,default:a});const u=s(h);var c=typeof t!=="undefined"?t:typeof window!=="undefined"?window:{};var f;if(typeof document!=="undefined"){f=document}else{f=c["__GLOBAL_DOCUMENT_CACHE@4"];if(!f){f=c["__GLOBAL_DOCUMENT_CACHE@4"]=u}}var l=f;var d=i((function(t,e){function i(t){if(t&&"object"===typeof t){var e=t.which||t.keyCode||t.charCode;if(e)t=e}if("number"===typeof t)return o[t];var i=String(t);var r=s[i.toLowerCase()];if(r)return r;var r=n[i.toLowerCase()];if(r)return r;if(i.length===1)return i.charCodeAt(0);return undefined}i.isEventKey=function t(e,i){if(e&&"object"===typeof e){var r=e.which||e.keyCode||e.charCode;if(r===null||r===undefined){return false}if(typeof i==="string"){var o=s[i.toLowerCase()];if(o){return o===r}var o=n[i.toLowerCase()];if(o){return o===r}}else if(typeof i==="number"){return i===r}return false}};e=t.exports=i;var s=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};var n=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};
|
|
2
|
+
/*!
|
|
3
|
+
* Programatically add the following
|
|
4
|
+
*/for(r=97;r<123;r++)s[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)s[r-48]=r;for(r=1;r<13;r++)s["f"+r]=r+111;for(r=0;r<10;r++)s["numpad "+r]=r+96;var o=e.names=e.title={};for(r in s)o[s[r]]=r;for(var a in n){s[a]=n[a]}}));var p=m;function m(t,e){var i;var s=null;try{i=JSON.parse(t,e)}catch(t){s=t}return[s,i]}var v=i((function(t){function e(){t.exports=e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)){t[s]=i[s]}}}return t},t.exports.__esModule=true,t.exports["default"]=t.exports;return e.apply(this,arguments)}t.exports=e,t.exports.__esModule=true,t.exports["default"]=t.exports}));const g=e(v);var y=w;var b=Object.prototype.toString;function w(t){if(!t){return false}var e=b.call(t);return e==="[object Function]"||typeof t==="function"&&e!=="[object RegExp]"||typeof window!=="undefined"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}var T=function t(e,i){if(i===void 0){i=false}return function(t,s,n){if(t){e(t);return}if(s.statusCode>=400&&s.statusCode<=599){var r=n;if(i){if(o.TextDecoder){var a=S(s.headers&&s.headers["content-type"]);try{r=new TextDecoder(a).decode(n)}catch(t){}}else{r=String.fromCharCode.apply(null,new Uint8Array(n))}}e({cause:r});return}e(null,n)}};function S(t){if(t===void 0){t=""}return t.toLowerCase().split(";").reduce((function(t,e){var i=e.split("="),s=i[0],n=i[1];if(s.trim()==="charset"){return n.trim()}return t}),"utf-8")}var k=T;j.httpHandler=k;
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
|
8
|
+
* Copyright (c) 2014 David Björklund
|
|
9
|
+
* Available under the MIT license
|
|
10
|
+
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
|
11
|
+
*/var E=function t(e){var i={};if(!e){return i}e.trim().split("\n").forEach((function(t){var e=t.indexOf(":");var s=t.slice(0,e).trim().toLowerCase();var n=t.slice(e+1).trim();if(typeof i[s]==="undefined"){i[s]=n}else if(Array.isArray(i[s])){i[s].push(n)}else{i[s]=[i[s],n]}}));return i};var I=j;var x=j;j.XMLHttpRequest=o.XMLHttpRequest||M;j.XDomainRequest="withCredentials"in new j.XMLHttpRequest?j.XMLHttpRequest:o.XDomainRequest;A(["get","put","post","patch","head","delete"],(function(t){j[t==="delete"?"del":t]=function(e,i,s){i=C(e,i,s);i.method=t.toUpperCase();return _(i)}}));function A(t,e){for(var i=0;i<t.length;i++){e(t[i])}}function D(t){for(var e in t){if(t.hasOwnProperty(e))return false}return true}function C(t,e,i){var s=t;if(y(e)){i=e;if(typeof t==="string"){s={uri:t}}}else{s=v({},e,{uri:t})}s.callback=i;return s}function j(t,e,i){e=C(t,e,i);return _(e)}function _(t){if(typeof t.callback==="undefined"){throw new Error("callback argument missing")}var e=false;var i=function i(s,n,r){if(!e){e=true;t.callback(s,n,r)}};function s(){if(a.readyState===4){setTimeout(o,0)}}function n(){var t=undefined;if(a.response){t=a.response}else{t=a.responseText||N(a)}if(m){try{t=JSON.parse(t)}catch(t){}}return t}function r(t){clearTimeout(v);if(!(t instanceof Error)){t=new Error(""+(t||"Unknown XMLHttpRequest Error"))}t.statusCode=0;return i(t,g)}function o(){if(u)return;var e;clearTimeout(v);if(t.useXDR&&a.status===undefined){e=200}else{e=a.status===1223?204:a.status}var s=g;var r=null;if(e!==0){s={body:n(),statusCode:e,method:f,headers:{},url:c,rawRequest:a};if(a.getAllResponseHeaders){s.headers=E(a.getAllResponseHeaders())}}else{r=new Error("Internal XMLHttpRequest Error")}return i(r,s,s.body)}var a=t.xhr||null;if(!a){if(t.cors||t.useXDR){a=new j.XDomainRequest}else{a=new j.XMLHttpRequest}}var h;var u;var c=a.url=t.uri||t.url;var f=a.method=t.method||"GET";var l=t.body||t.data;var d=a.headers=t.headers||{};var p=!!t.sync;var m=false;var v;var g={body:undefined,headers:{},statusCode:0,method:f,url:c,rawRequest:a};if("json"in t&&t.json!==false){m=true;d["accept"]||d["Accept"]||(d["Accept"]="application/json");if(f!=="GET"&&f!=="HEAD"){d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json");l=JSON.stringify(t.json===true?l:t.json)}}a.onreadystatechange=s;a.onload=o;a.onerror=r;a.onprogress=function(){};a.onabort=function(){u=true};a.ontimeout=r;a.open(f,c,!p,t.username,t.password);if(!p){a.withCredentials=!!t.withCredentials}if(!p&&t.timeout>0){v=setTimeout((function(){if(u)return;u=true;a.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT";r(t)}),t.timeout)}if(a.setRequestHeader){for(h in d){if(d.hasOwnProperty(h)){a.setRequestHeader(h,d[h])}}}else if(t.headers&&!D(t.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in t){a.responseType=t.responseType}if("beforeSend"in t&&typeof t.beforeSend==="function"){t.beforeSend(a)}a.send(l||null);return a}function N(t){try{if(t.responseType==="document"){return t.responseXML}var e=t.responseXML&&t.responseXML.documentElement.nodeName==="parsererror";if(t.responseType===""&&!e){return t.responseXML}}catch(t){}return null}function M(){}I.default=x;var O=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 L(t,e){this.name="ParsingError";this.code=t.code;this.message=e||t.message}L.prototype=O(Error.prototype);L.prototype.constructor=L;L.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function R(t){function e(t,e,i,s){return(t|0)*3600+(e|0)*60+(i|0)+(s|0)/1e3}var i=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!i){return null}if(i[3]){return e(i[1],i[2],i[3].replace(":",""),i[4])}else if(i[1]>59){return e(i[1],i[2],0,i[4])}else{return e(0,i[1],i[2],i[4])}}function $(){this.values=O(null)}$.prototype={set:function(t,e){if(!this.get(t)&&e!==""){this.values[t]=e}},get:function(t,e,i){if(i){return this.has(t)?this.values[t]:e[i]}return this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var s=0;s<i.length;++s){if(e===i[s]){this.set(t,e);break}}},integer:function(t,e){if(/^-?\d+$/.test(e)){this.set(t,parseInt(e,10))}},percent:function(t,e){if(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)){e=parseFloat(e);if(e>=0&&e<=100){this.set(t,e);return true}}return false}};function P(t,e,i,s){var n=s?t.split(s):[t];for(var r in n){if(typeof n[r]!=="string"){continue}var o=n[r].split(i);if(o.length!==2){continue}var a=o[0].trim();var h=o[1].trim();e(a,h)}}function U(t,e,i){var s=t;function n(){var e=R(t);if(e===null){throw new L(L.Errors.BadTimeStamp,"Malformed timestamp: "+s)}t=t.replace(/^[^\sa-zA-Z-]+/,"");return e}function r(t,e){var s=new $;P(t,(function(t,e){switch(t){case"region":for(var n=i.length-1;n>=0;n--){if(i[n].id===e){s.set(t,i[n].region);break}}break;case"vertical":s.alt(t,e,["rl","lr"]);break;case"line":var r=e.split(","),o=r[0];s.integer(t,o);s.percent(t,o)?s.set("snapToLines",false):null;s.alt(t,o,["auto"]);if(r.length===2){s.alt("lineAlign",r[1],["start","center","end"])}break;case"position":r=e.split(",");s.percent(t,r[0]);if(r.length===2){s.alt("positionAlign",r[1],["start","center","end"])}break;case"size":s.percent(t,e);break;case"align":s.alt(t,e,["start","center","end","left","right"]);break}}),/:/,/\s/);e.region=s.get("region",null);e.vertical=s.get("vertical","");try{e.line=s.get("line","auto")}catch(t){}e.lineAlign=s.get("lineAlign","start");e.snapToLines=s.get("snapToLines",true);e.size=s.get("size",100);try{e.align=s.get("align","center")}catch(t){e.align=s.get("align","middle")}try{e.position=s.get("position","auto")}catch(t){e.position=s.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align)}e.positionAlign=s.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align)}function o(){t=t.replace(/^\s+/,"")}o();e.startTime=n();o();if(t.substr(0,3)!=="--\x3e"){throw new L(L.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+s)}t=t.substr(3);o();e.endTime=n();o();r(t,e)}var F=l.createElement&&l.createElement("textarea");var B={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var q={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 V={v:"title",lang:"lang"};var H={rt:"ruby"};function z(t,e){function i(){if(!e){return null}function t(t){e=e.substr(t.length);return t}var i=e.match(/^([^<]*)(<[^>]*>?)?/);return t(i[1]?i[1]:i[2])}function s(t){F.innerHTML=t;t=F.textContent;F.textContent="";return t}function n(t,e){return!H[e.localName]||H[e.localName]===t.localName}function r(e,i){var s=B[e];if(!s){return null}var n=t.document.createElement(s);var r=V[e];if(r&&i){n[r]=i.trim()}return n}var o=t.document.createElement("div"),a=o,h,u=[];while((h=i())!==null){if(h[0]==="<"){if(h[1]==="/"){if(u.length&&u[u.length-1]===h.substr(2).replace(">","")){u.pop();a=a.parentNode}continue}var c=R(h.substr(1,h.length-2));var f;if(c){f=t.document.createProcessingInstruction("timestamp",c);a.appendChild(f);continue}var l=h.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l){continue}f=r(l[1],l[3]);if(!f){continue}if(!n(a,f)){continue}if(l[2]){var d=l[2].split(".");d.forEach((function(t){var e=/^bg_/.test(t);var i=e?t.slice(3):t;if(q.hasOwnProperty(i)){var s=e?"background-color":"color";var n=q[i];f.style[s]=n}}));f.className=d.join(" ")}u.push(l[1]);a.appendChild(f);a=f;continue}a.appendChild(t.document.createTextNode(s(h)))}return o}var X=[[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 G(t){for(var e=0;e<X.length;e++){var i=X[e];if(t>=i[0]&&t<=i[1]){return true}}return false}function W(t){var e=[],i="",s;if(!t||!t.childNodes){return"ltr"}function n(t,e){for(var i=e.childNodes.length-1;i>=0;i--){t.push(e.childNodes[i])}}function r(t){if(!t||!t.length){return null}var e=t.pop(),i=e.textContent||e.innerText;if(i){var s=i.match(/^.*(\n|\r)/);if(s){t.length=0;return s[0]}return i}if(e.tagName==="ruby"){return r(t)}if(e.childNodes){n(t,e);return r(t)}}n(e,t);while(i=r(e)){for(var o=0;o<i.length;o++){s=i.charCodeAt(o);if(G(s)){return"rtl"}}}return"ltr"}function Y(t){if(typeof t.line==="number"&&(t.snapToLines||t.line>=0&&t.line<=100)){return t.line}if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement){return-1}var e=t.track,i=e.textTrackList,s=0;for(var n=0;n<i.length&&i[n]!==e;n++){if(i[n].mode==="showing"){s++}}return++s*-1}function K(){}K.prototype.applyStyles=function(t,e){e=e||this.div;for(var i in t){if(t.hasOwnProperty(i)){e.style[i]=t[i]}}};K.prototype.formatStyle=function(t,e){return t===0?0:t+e};function Q(t,e,i){K.call(this);this.cue=e;this.cueDiv=z(t,e.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:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv);this.div=t.document.createElement("div");s={direction:W(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:i.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(s);this.div.appendChild(this.cueDiv);var n=0;switch(e.positionAlign){case"start":case"line-left":n=e.position;break;case"center":n=e.position-e.size/2;break;case"end":case"line-right":n=e.position-e.size;break}if(e.vertical===""){this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(e.size,"%")})}else{this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(e.size,"%")})}this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")})}}Q.prototype=O(K.prototype);Q.prototype.constructor=Q;function J(t){var e,i,s,n;if(t.div){i=t.div.offsetHeight;s=t.div.offsetWidth;n=t.div.offsetTop;var r=(r=t.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();t=t.div.getBoundingClientRect();e=r?Math.max(r[0]&&r[0].height||0,t.height/r.length):0}this.left=t.left;this.right=t.right;this.top=t.top||n;this.height=t.height||i;this.bottom=t.bottom||n+(t.height||i);this.width=t.width||s;this.lineHeight=e!==undefined?e:t.lineHeight}J.prototype.move=function(t,e){e=e!==undefined?e:this.lineHeight;switch(t){case"+x":this.left+=e;this.right+=e;break;case"-x":this.left-=e;this.right-=e;break;case"+y":this.top+=e;this.bottom+=e;break;case"-y":this.top-=e;this.bottom-=e;break}};J.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top};J.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++){if(this.overlaps(t[e])){return true}}return false};J.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right};J.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}};J.prototype.intersectPercentage=function(t){var e=Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left)),i=Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top)),s=e*i;return s/(this.height*this.width)};J.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}};J.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0;var i=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0;var s=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t;var n={left:t.left,right:t.right,top:t.top||s,height:t.height||e,bottom:t.bottom||s+(t.height||e),width:t.width||i};return n};function Z(t,e,i,s){function n(t,e){var n,r=new J(t),o=1;for(var a=0;a<e.length;a++){while(t.overlapsOppositeAxis(i,e[a])||t.within(i)&&t.overlapsAny(s)){t.move(e[a])}if(t.within(i)){return t}var h=t.intersectPercentage(i);if(o>h){n=new J(t);o=h}t=new J(r)}return n||r}var r=new J(e),o=e.cue,a=Y(o),h=[];if(o.snapToLines){var u;switch(o.vertical){case"":h=["+y","-y"];u="height";break;case"rl":h=["+x","-x"];u="width";break;case"lr":h=["-x","+x"];u="width";break}var c=r.lineHeight,f=c*Math.round(a),l=i[u]+c,d=h[0];if(Math.abs(f)>l){f=f<0?-1:1;f*=Math.ceil(l/c)*c}if(a<0){f+=o.vertical===""?i.height:i.width;h=h.reverse()}r.move(d,f)}else{var p=r.lineHeight/i.height*100;switch(o.lineAlign){case"center":a-=p/2;break;case"end":a-=p;break}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(a,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(a,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(a,"%")});break}h=["+y","-x","+x","-y"];r=new J(e)}var m=n(r,h);e.move(m.toCSSCompatValues(i))}function tt(){}tt.StringDecoder=function(){return{decode:function(t){if(!t){return""}if(typeof t!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(t))}}};tt.convertCueToDOMTree=function(t,e){if(!t||!e){return null}return z(t,e)};var et=.05;var it="sans-serif";var st="1.5%";tt.processCues=function(t,e,i){if(!t||!e||!i){return null}while(i.firstChild){i.removeChild(i.firstChild)}var s=t.document.createElement("div");s.style.position="absolute";s.style.left="0";s.style.right="0";s.style.top="0";s.style.bottom="0";s.style.margin=st;i.appendChild(s);function n(t){for(var e=0;e<t.length;e++){if(t[e].hasBeenReset||!t[e].displayState){return true}}return false}if(!n(e)){for(var r=0;r<e.length;r++){s.appendChild(e[r].displayState)}return}var o=[],a=J.getSimpleBoxPosition(s),h=Math.round(a.height*et*100)/100;var u={font:h+"px "+it};(function(){var i,n;for(var r=0;r<e.length;r++){n=e[r];i=new Q(t,n,u);s.appendChild(i.div);Z(t,i,a,o);n.displayState=i.div;o.push(J.getSimpleBoxPosition(i))}})()};tt.Parser=function(t,e,i){if(!i){i=e;e={}}if(!e){e={}}this.window=t;this.vttjs=e;this.state="INITIAL";this.buffer="";this.decoder=i||new TextDecoder("utf8");this.regionList=[]};tt.Parser.prototype={reportOrThrowError:function(t){if(t instanceof L){this.onparsingerror&&this.onparsingerror(t)}else{throw t}},parse:function(t){var e=this;if(t){e.buffer+=e.decoder.decode(t,{stream:true})}function i(){var t=e.buffer;var i=0;while(i<t.length&&t[i]!=="\r"&&t[i]!=="\n"){++i}var s=t.substr(0,i);if(t[i]==="\r"){++i}if(t[i]==="\n"){++i}e.buffer=t.substr(i);return s}function s(t){var i=new $;P(t,(function(t,e){switch(t){case"id":i.set(t,e);break;case"width":i.percent(t,e);break;case"lines":i.integer(t,e);break;case"regionanchor":case"viewportanchor":var s=e.split(",");if(s.length!==2){break}var n=new $;n.percent("x",s[0]);n.percent("y",s[1]);if(!n.has("x")||!n.has("y")){break}i.set(t+"X",n.get("x"));i.set(t+"Y",n.get("y"));break;case"scroll":i.alt(t,e,["up"]);break}}),/=/,/\s/);if(i.has("id")){var s=new(e.vttjs.VTTRegion||e.window.VTTRegion);s.width=i.get("width",100);s.lines=i.get("lines",3);s.regionAnchorX=i.get("regionanchorX",0);s.regionAnchorY=i.get("regionanchorY",100);s.viewportAnchorX=i.get("viewportanchorX",0);s.viewportAnchorY=i.get("viewportanchorY",100);s.scroll=i.get("scroll","");e.onregion&&e.onregion(s);e.regionList.push({id:i.get("id"),region:s})}}function n(t){var i=new $;P(t,(function(t,e){switch(t){case"MPEGT":i.integer(t+"S",e);break;case"LOCA":i.set(t+"L",R(e));break}}),/[^\d]:/,/,/);e.ontimestampmap&&e.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function r(t){if(t.match(/X-TIMESTAMP-MAP/)){P(t,(function(t,e){switch(t){case"X-TIMESTAMP-MAP":n(e);break}}),/=/)}else{P(t,(function(t,e){switch(t){case"Region":s(e);break}}),/:/)}}try{var o;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer)){return this}o=i();var a=o.match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0]){throw new L(L.Errors.BadSignature)}e.state="HEADER"}var h=false;while(e.buffer){if(!/\r\n|\n/.test(e.buffer)){return this}if(!h){o=i()}else{h=false}switch(e.state){case"HEADER":if(/:/.test(o)){r(o)}else if(!o){e.state="ID"}continue;case"NOTE":if(!o){e.state="ID"}continue;case"ID":if(/^NOTE($|[ \t])/.test(o)){e.state="NOTE";break}if(!o){continue}e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch(t){e.cue.align="middle"}e.state="CUE";if(o.indexOf("--\x3e")===-1){e.cue.id=o;continue}case"CUE":try{U(o,e.cue,e.regionList)}catch(t){e.reportOrThrowError(t);e.cue=null;e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var u=o.indexOf("--\x3e")!==-1;if(!o||u&&(h=true)){e.oncue&&e.oncue(e.cue);e.cue=null;e.state="ID";continue}if(e.cue.text){e.cue.text+="\n"}e.cue.text+=o.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":if(!o){e.state="ID"}continue}}}catch(t){e.reportOrThrowError(t);if(e.state==="CUETEXT"&&e.cue&&e.oncue){e.oncue(e.cue)}e.cue=null;e.state=e.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 L(L.Errors.BadSignature)}}catch(e){t.reportOrThrowError(e)}t.onflush&&t.onflush();return this}};var nt=tt;var rt="auto";var ot={"":1,lr:1,rl:1};var at={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function ht(t){if(typeof t!=="string"){return false}var e=ot[t.toLowerCase()];return e?t.toLowerCase():false}function ut(t){if(typeof t!=="string"){return false}var e=at[t.toLowerCase()];return e?t.toLowerCase():false}function ct(t,e,i){this.hasBeenReset=false;var s="";var n=false;var r=t;var o=e;var a=i;var h=null;var u="";var c=true;var f="auto";var l="start";var d="auto";var p="auto";var m=100;var v="center";Object.defineProperties(this,{id:{enumerable:true,get:function(){return s},set:function(t){s=""+t}},pauseOnExit:{enumerable:true,get:function(){return n},set:function(t){n=!!t}},startTime:{enumerable:true,get:function(){return r},set:function(t){if(typeof t!=="number"){throw new TypeError("Start time must be set to a number.")}r=t;this.hasBeenReset=true}},endTime:{enumerable:true,get:function(){return o},set:function(t){if(typeof t!=="number"){throw new TypeError("End time must be set to a number.")}o=t;this.hasBeenReset=true}},text:{enumerable:true,get:function(){return a},set:function(t){a=""+t;this.hasBeenReset=true}},region:{enumerable:true,get:function(){return h},set:function(t){h=t;this.hasBeenReset=true}},vertical:{enumerable:true,get:function(){return u},set:function(t){var e=ht(t);if(e===false){throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.")}u=e;this.hasBeenReset=true}},snapToLines:{enumerable:true,get:function(){return c},set:function(t){c=!!t;this.hasBeenReset=true}},line:{enumerable:true,get:function(){return f},set:function(t){if(typeof t!=="number"&&t!==rt){throw new SyntaxError("Line: an invalid number or illegal string was specified.")}f=t;this.hasBeenReset=true}},lineAlign:{enumerable:true,get:function(){return l},set:function(t){var e=ut(t);if(!e){console.warn("lineAlign: an invalid or illegal string was specified.")}else{l=e;this.hasBeenReset=true}}},position:{enumerable:true,get:function(){return d},set:function(t){if(t<0||t>100){throw new Error("Position must be between 0 and 100.")}d=t;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function(){return p},set:function(t){var e=ut(t);if(!e){console.warn("positionAlign: an invalid or illegal string was specified.")}else{p=e;this.hasBeenReset=true}}},size:{enumerable:true,get:function(){return m},set:function(t){if(t<0||t>100){throw new Error("Size must be between 0 and 100.")}m=t;this.hasBeenReset=true}},align:{enumerable:true,get:function(){return v},set:function(t){var e=ut(t);if(!e){throw new SyntaxError("align: an invalid or illegal alignment string was specified.")}v=e;this.hasBeenReset=true}}});this.displayState=undefined}ct.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var ft=ct;var lt={"":true,up:true};function dt(t){if(typeof t!=="string"){return false}var e=lt[t.toLowerCase()];return e?t.toLowerCase():false}function pt(t){return typeof t==="number"&&(t>=0&&t<=100)}function mt(){var t=100;var e=3;var i=0;var s=100;var n=0;var r=100;var o="";Object.defineProperties(this,{width:{enumerable:true,get:function(){return t},set:function(e){if(!pt(e)){throw new Error("Width must be between 0 and 100.")}t=e}},lines:{enumerable:true,get:function(){return e},set:function(t){if(typeof t!=="number"){throw new TypeError("Lines must be set to a number.")}e=t}},regionAnchorY:{enumerable:true,get:function(){return s},set:function(t){if(!pt(t)){throw new Error("RegionAnchorX must be between 0 and 100.")}s=t}},regionAnchorX:{enumerable:true,get:function(){return i},set:function(t){if(!pt(t)){throw new Error("RegionAnchorY must be between 0 and 100.")}i=t}},viewportAnchorY:{enumerable:true,get:function(){return r},set:function(t){if(!pt(t)){throw new Error("ViewportAnchorY must be between 0 and 100.")}r=t}},viewportAnchorX:{enumerable:true,get:function(){return n},set:function(t){if(!pt(t)){throw new Error("ViewportAnchorX must be between 0 and 100.")}n=t}},scroll:{enumerable:true,get:function(){return o},set:function(t){var e=dt(t);if(e===false){console.warn("Scroll: an invalid or illegal string was specified.")}else{o=e}}}})}var vt=mt;var gt=i((function(t){var e=t.exports={WebVTT:nt,VTTCue:ft,VTTRegion:vt};o.vttjs=e;o.WebVTT=e.WebVTT;var i=e.VTTCue;var s=e.VTTRegion;var n=o.VTTCue;var r=o.VTTRegion;e.shim=function(){o.VTTCue=i;o.VTTRegion=s};e.restore=function(){o.VTTCue=n;o.VTTRegion=r};if(!o.VTTCue){e.shim()}}));var yt=i((function(t,e){(function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;var s=/^(?=([^\/?#]*))\1([^]*)$/;var n=/(?:\/|^)\.(?=\/)/g;var r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var o={buildAbsoluteURL:function(t,e,i){i=i||{};t=t.trim();e=e.trim();if(!e){if(!i.alwaysNormalize){return t}var n=o.parseURL(t);if(!n){throw new Error("Error trying to parse base URL.")}n.path=o.normalizePath(n.path);return o.buildURLFromParts(n)}var r=o.parseURL(e);if(!r){throw new Error("Error trying to parse relative URL.")}if(r.scheme){if(!i.alwaysNormalize){return e}r.path=o.normalizePath(r.path);return o.buildURLFromParts(r)}var a=o.parseURL(t);if(!a){throw new Error("Error trying to parse base URL.")}if(!a.netLoc&&a.path&&a.path[0]!=="/"){var h=s.exec(a.path);a.netLoc=h[1];a.path=h[2]}if(a.netLoc&&!a.path){a.path="/"}var u={scheme:a.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc){u.netLoc=a.netLoc;if(r.path[0]!=="/"){if(!r.path){u.path=a.path;if(!r.params){u.params=a.params;if(!r.query){u.query=a.query}}}else{var c=a.path;var f=c.substring(0,c.lastIndexOf("/")+1)+r.path;u.path=o.normalizePath(f)}}}if(u.path===null){u.path=i.alwaysNormalize?o.normalizePath(r.path):r.path}return o.buildURLFromParts(u)},parseURL:function(t){var e=i.exec(t);if(!e){return null}return{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}},normalizePath:function(t){t=t.split("").reverse().join("").replace(n,"");while(t.length!==(t=t.replace(r,"")).length){}return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=o})()}));var bt="http://example.com";var wt=function t(e,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(e)){e=o.location&&o.location.href||""}var s=typeof o.URL==="function";var n=/^\/\//.test(e);var r=!o.location&&!/\/\//i.test(e);if(s){e=new o.URL(e,o.location||bt)}else if(!/\/\//i.test(e)){e=yt.buildAbsoluteURL(o.location&&o.location.href||"",e)}if(s){var a=new URL(i,e);if(r){return a.href.slice(bt.length)}else if(n){return a.href.slice(a.protocol.length)}return a.href}return yt.buildAbsoluteURL(e,i)};var Tt=function(){function t(){this.listeners={}}var e=t.prototype;e.on=function t(e,i){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(i)};e.off=function t(e,i){if(!this.listeners[e]){return false}var s=this.listeners[e].indexOf(i);this.listeners[e]=this.listeners[e].slice(0);this.listeners[e].splice(s,1);return s>-1};e.trigger=function t(e){var i=this.listeners[e];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 o=i.length;for(var a=0;a<o;++a){i[a].apply(this,r)}}};e.dispose=function t(){this.listeners={}};e.pipe=function t(e){this.on("data",(function(t){e.push(t)}))};return t}();var St=function t(e){return o.atob?o.atob(e):Buffer.from(e,"base64").toString("binary")};function kt(t){var e=St(t);var i=new Uint8Array(e.length);for(var s=0;s<e.length;s++){i[s]=e.charCodeAt(s)}return i}
|
|
12
|
+
/*! @name m3u8-parser @version 6.2.0 @license Apache-2.0 */class Et extends Tt{constructor(){super();this.buffer=""}push(t){let e;this.buffer+=t;e=this.buffer.indexOf("\n");for(;e>-1;e=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,e));this.buffer=this.buffer.substring(e+1)}}}const It=String.fromCharCode(9);const xt=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||"");const i={};if(e[1]){i.length=parseInt(e[1],10)}if(e[2]){i.offset=parseInt(e[2],10)}return i};const At=function(){const t="[^=]*";const e='"[^"]*"|[^,]*';const i="(?:"+t+")=(?:"+e+")";return new RegExp("(?:^|,)("+i+")")};const Dt=function(t){const e={};if(!t){return e}const i=t.split(At());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");e[n[0]]=n[1]}return e};class Ct extends Tt{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(t){let e;let i;t=t.trim();if(t.length===0){return}if(t[0]!=="#"){this.trigger("data",{type:"uri",uri:t});return}const s=this.tagMappers.reduce(((e,i)=>{const s=i(t);if(s===t){return e}return e.concat([s])}),[t]);s.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","");e=/^#EXTM3U/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"m3u"});return}e=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"inf"};if(e[1]){i.duration=parseFloat(e[1])}if(e[2]){i.title=e[2]}this.trigger("data",i);return}e=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"targetduration"};if(e[1]){i.duration=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"version"};if(e[1]){i.version=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"media-sequence"};if(e[1]){i.number=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"discontinuity-sequence"};if(e[1]){i.number=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"playlist-type"};if(e[1]){i.playlistType=e[1]}this.trigger("data",i);return}e=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t);if(e){i=g(xt(e[1]),{type:"tag",tagType:"byterange"});this.trigger("data",i);return}e=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t);if(e){i={type:"tag",tagType:"allow-cache"};if(e[1]){i.allowed=!/NO/.test(e[1])}this.trigger("data",i);return}e=/^#EXT-X-MAP:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"map"};if(e[1]){const t=Dt(e[1]);if(t.URI){i.uri=t.URI}if(t.BYTERANGE){i.byterange=xt(t.BYTERANGE)}}this.trigger("data",i);return}e=/^#EXT-X-STREAM-INF:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"stream-inf"};if(e[1]){i.attributes=Dt(e[1]);if(i.attributes.RESOLUTION){const t=i.attributes.RESOLUTION.split("x");const e={};if(t[0]){e.width=parseInt(t[0],10)}if(t[1]){e.height=parseInt(t[1],10)}i.attributes.RESOLUTION=e}if(i.attributes.BANDWIDTH){i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)}if(i.attributes["FRAME-RATE"]){i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])}if(i.attributes["PROGRAM-ID"]){i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10)}}this.trigger("data",i);return}e=/^#EXT-X-MEDIA:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"media"};if(e[1]){i.attributes=Dt(e[1])}this.trigger("data",i);return}e=/^#EXT-X-ENDLIST/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"endlist"});return}e=/^#EXT-X-DISCONTINUITY/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}e=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"program-date-time"};if(e[1]){i.dateTimeString=e[1];i.dateTimeObject=new Date(e[1])}this.trigger("data",i);return}e=/^#EXT-X-KEY:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"key"};if(e[1]){i.attributes=Dt(e[1]);if(i.attributes.IV){if(i.attributes.IV.substring(0,2).toLowerCase()==="0x"){i.attributes.IV=i.attributes.IV.substring(2)}i.attributes.IV=i.attributes.IV.match(/.{8}/g);i.attributes.IV[0]=parseInt(i.attributes.IV[0],16);i.attributes.IV[1]=parseInt(i.attributes.IV[1],16);i.attributes.IV[2]=parseInt(i.attributes.IV[2],16);i.attributes.IV[3]=parseInt(i.attributes.IV[3],16);i.attributes.IV=new Uint32Array(i.attributes.IV)}}this.trigger("data",i);return}e=/^#EXT-X-START:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"start"};if(e[1]){i.attributes=Dt(e[1]);i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]);i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)}this.trigger("data",i);return}e=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"cue-out-cont"};if(e[1]){i.data=e[1]}else{i.data=""}this.trigger("data",i);return}e=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"cue-out"};if(e[1]){i.data=e[1]}else{i.data=""}this.trigger("data",i);return}e=/^#EXT-X-CUE-IN:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"cue-in"};if(e[1]){i.data=e[1]}else{i.data=""}this.trigger("data",i);return}e=/^#EXT-X-SKIP:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"skip"};i.attributes=Dt(e[1]);if(i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")){i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)}if(i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")){i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(It)}this.trigger("data",i);return}e=/^#EXT-X-PART:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"part"};i.attributes=Dt(e[1]);["DURATION"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));["INDEPENDENT","GAP"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=/YES/.test(i.attributes[t])}}));if(i.attributes.hasOwnProperty("BYTERANGE")){i.attributes.byterange=xt(i.attributes.BYTERANGE)}this.trigger("data",i);return}e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"server-control"};i.attributes=Dt(e[1]);["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=/YES/.test(i.attributes[t])}}));this.trigger("data",i);return}e=/^#EXT-X-PART-INF:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"part-inf"};i.attributes=Dt(e[1]);["PART-TARGET"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));this.trigger("data",i);return}e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"preload-hint"};i.attributes=Dt(e[1]);["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseInt(i.attributes[t],10);const e=t==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{};i.attributes.byterange[e]=i.attributes[t];delete i.attributes[t]}}));this.trigger("data",i);return}e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"rendition-report"};i.attributes=Dt(e[1]);["LAST-MSN","LAST-PART"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseInt(i.attributes[t],10)}}));this.trigger("data",i);return}e=/^#EXT-X-DATERANGE:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"daterange"};i.attributes=Dt(e[1]);["ID","CLASS"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=String(i.attributes[t])}}));["START-DATE","END-DATE"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=new Date(i.attributes[t])}}));["DURATION","PLANNED-DURATION"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));["END-ON-NEXT"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=/YES/i.test(i.attributes[t])}}));["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=i.attributes[t].toString(16)}}));const t=/^X-([A-Z]+-)+[A-Z]+$/;for(const e in i.attributes){if(!t.test(e)){continue}const s=/[0-9A-Fa-f]{6}/g.test(i.attributes[e]);const n=/^\d+(\.\d+)?$/.test(i.attributes[e]);i.attributes[e]=s?i.attributes[e].toString(16):n?parseFloat(i.attributes[e]):String(i.attributes[e])}this.trigger("data",i);return}e=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}this.trigger("data",{type:"tag",data:t.slice(4)})}))}addParser({expression:t,customType:e,dataParser:i,segment:s}){if(typeof i!=="function"){i=t=>t}this.customParsers.push((n=>{const r=t.exec(n);if(r){this.trigger("data",{type:"custom",data:i(n),customType:e,segment:s});return true}}))}addTagMapper({expression:t,map:e}){const i=i=>{if(t.test(i)){return e(i)}return i};this.tagMappers.push(i)}}const jt=t=>t.toLowerCase().replace(/-(\w)/g,(t=>t[1].toUpperCase()));const _t=function(t){const e={};Object.keys(t).forEach((function(i){e[jt(i)]=t[i]}));return e};const Nt=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:s}=t;if(!e){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const o="partHoldBack";const a=i&&i*3;const h=s&&s*2;if(i&&!e.hasOwnProperty(r)){e[r]=a;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${a}).`})}if(a&&e[r]<a){this.trigger("warn",{message:`${n} clamping HOLD-BACK (${e[r]}) to targetDuration * 3 (${a})`});e[r]=a}if(s&&!e.hasOwnProperty(o)){e[o]=s*3;this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[o]}).`})}if(s&&e[o]<h){this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${e[o]}) to partTargetDuration * 2 (${h}).`});e[o]=h}};class Mt extends Tt{constructor(){super();this.lineStream=new Et;this.parseStream=new Ct;this.lineStream.pipe(this.parseStream);const t=this;const e=[];let i={};let s;let n;let r=false;const o=function(){};const a={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};const h="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let u=0;this.manifest={allowCache:true,discontinuityStarts:[],segments:[]};let c=0;let f=0;const l={};this.on("end",(()=>{if(i.uri||!i.parts&&!i.preloadHints){return}if(!i.map&&s){i.map=s}if(!i.key&&n){i.key=n}if(!i.timeline&&typeof u==="number"){i.timeline=u}this.manifest.preloadSegment=i}));this.parseStream.on("data",(function(d){let p;let m;({tag(){({version(){if(d.version){this.manifest.version=d.version}},"allow-cache"(){this.manifest.allowCache=d.allowed;if(!("allowed"in d)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const t={};if("length"in d){i.byterange=t;t.length=d.length;if(!("offset"in d)){d.offset=c}}if("offset"in d){i.byterange=t;t.offset=d.offset}c=t.offset+t.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(d.duration>0){i.duration=d.duration}if(d.duration===0){i.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=e},key(){if(!d.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(d.attributes.METHOD==="NONE"){n=null;return}if(!d.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(d.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:d.attributes};return}if(d.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:d.attributes.URI};return}if(d.attributes.KEYFORMAT===h){const t=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(t.indexOf(d.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(d.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(d.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(d.attributes.KEYID&&d.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:d.attributes.KEYFORMAT,keyId:d.attributes.KEYID.substring(2)},pssh:kt(d.attributes.URI.split(",")[1])};return}if(!d.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}n={method:d.attributes.METHOD||"AES-128",uri:d.attributes.URI};if(typeof d.attributes.IV!=="undefined"){n.iv=d.attributes.IV}},"media-sequence"(){if(!isFinite(d.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+d.number});return}this.manifest.mediaSequence=d.number},"discontinuity-sequence"(){if(!isFinite(d.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+d.number});return}this.manifest.discontinuitySequence=d.number;u=d.number},"playlist-type"(){if(!/VOD|EVENT/.test(d.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+d.playlist});return}this.manifest.playlistType=d.playlistType},map(){s={};if(d.uri){s.uri=d.uri}if(d.byterange){s.byterange=d.byterange}if(n){s.key=n}},"stream-inf"(){this.manifest.playlists=e;this.manifest.mediaGroups=this.manifest.mediaGroups||a;if(!d.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!i.attributes){i.attributes={}}g(i.attributes,d.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||a;if(!(d.attributes&&d.attributes.TYPE&&d.attributes["GROUP-ID"]&&d.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const t=this.manifest.mediaGroups[d.attributes.TYPE];t[d.attributes["GROUP-ID"]]=t[d.attributes["GROUP-ID"]]||{};p=t[d.attributes["GROUP-ID"]];m={default:/yes/i.test(d.attributes.DEFAULT)};if(m.default){m.autoselect=true}else{m.autoselect=/yes/i.test(d.attributes.AUTOSELECT)}if(d.attributes.LANGUAGE){m.language=d.attributes.LANGUAGE}if(d.attributes.URI){m.uri=d.attributes.URI}if(d.attributes["INSTREAM-ID"]){m.instreamId=d.attributes["INSTREAM-ID"]}if(d.attributes.CHARACTERISTICS){m.characteristics=d.attributes.CHARACTERISTICS}if(d.attributes.FORCED){m.forced=/yes/i.test(d.attributes.FORCED)}p[d.attributes.NAME]=m},discontinuity(){u+=1;i.discontinuity=true;this.manifest.discontinuityStarts.push(e.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=d.dateTimeString;this.manifest.dateTimeObject=d.dateTimeObject}i.dateTimeString=d.dateTimeString;i.dateTimeObject=d.dateTimeObject},targetduration(){if(!isFinite(d.duration)||d.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+d.duration});return}this.manifest.targetDuration=d.duration;Nt.call(this,this.manifest)},start(){if(!d.attributes||isNaN(d.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:d.attributes["TIME-OFFSET"],precise:d.attributes.PRECISE}},"cue-out"(){i.cueOut=d.data},"cue-out-cont"(){i.cueOutCont=d.data},"cue-in"(){i.cueIn=d.data},skip(){this.manifest.skip=_t(d.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",d.attributes,["SKIPPED-SEGMENTS"])},part(){r=true;const t=this.manifest.segments.length;const e=_t(d.attributes);i.parts=i.parts||[];i.parts.push(e);if(e.byterange){if(!e.byterange.hasOwnProperty("offset")){e.byterange.offset=f}f=e.byterange.offset+e.byterange.length}const s=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${s} for segment #${t}`,d.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach(((t,e)=>{if(!t.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${e} lacks required attribute(s): LAST-PART`})}}))}},"server-control"(){const t=this.manifest.serverControl=_t(d.attributes);if(!t.hasOwnProperty("canBlockReload")){t.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}Nt.call(this,this.manifest);if(t.canSkipDateranges&&!t.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 e=_t(d.attributes);const s=e.type&&e.type==="PART";i.preloadHints=i.preloadHints||[];i.preloadHints.push(e);if(e.byterange){if(!e.byterange.hasOwnProperty("offset")){e.byterange.offset=s?f:0;if(s){f=e.byterange.offset+e.byterange.length}}}const n=i.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${t}`,d.attributes,["TYPE","URI"]);if(!e.type){return}for(let s=0;s<i.preloadHints.length-1;s++){const r=i.preloadHints[s];if(!r.type){continue}if(r.type===e.type){this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${t} has the same TYPE ${e.type} as preload hint #${s}`})}}},"rendition-report"(){const t=_t(d.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(t);const e=this.manifest.renditionReports.length-1;const i=["LAST-MSN","URI"];if(r){i.push("LAST-PART")}this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${e}`,d.attributes,i)},"part-inf"(){this.manifest.partInf=_t(d.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",d.attributes,["PART-TARGET"]);if(this.manifest.partInf.partTarget){this.manifest.partTargetDuration=this.manifest.partInf.partTarget}Nt.call(this,this.manifest)},daterange(){this.manifest.daterange=this.manifest.daterange||[];this.manifest.daterange.push(_t(d.attributes));const t=this.manifest.daterange.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,d.attributes,["ID","START-DATE"]);const e=this.manifest.daterange[t];if(e.endDate&&e.startDate&&new Date(e.endDate)<new Date(e.startDate)){this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"})}if(e.duration&&e.duration<0){this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"})}if(e.plannedDuration&&e.plannedDuration<0){this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"})}const i=!!e.endOnNext;if(i&&!e.class){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"})}if(i&&(e.duration||e.endDate)){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"})}if(e.duration&&e.endDate){const i=e.startDate;const s=i.setSeconds(i.getSeconds()+e.duration);this.manifest.daterange[t].endDate=new Date(s)}if(e&&!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(!l[e.id]){l[e.id]=e}else{for(const t in l[e.id]){if(l[e.id][t]!==e[t]){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}}[d.tagType]||o).call(t)},uri(){i.uri=d.uri;e.push(i);if(this.manifest.targetDuration&&!("duration"in i)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});i.duration=this.manifest.targetDuration}if(n){i.key=n}i.timeline=u;if(s){i.map=s}f=0;i={}},comment(){},custom(){if(d.segment){i.custom=i.custom||{};i.custom[d.customType]=d.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[d.customType]=d.data}}})[d.type].call(t)}))}warnOnMissingAttributes_(t,e,i){const s=[];i.forEach((function(t){if(!e.hasOwnProperty(t)){s.push(t)}}));if(s.length){this.trigger("warn",{message:`${t} lacks required attribute(s): ${s.join(", ")}`})}}push(t){this.lineStream.push(t)}end(){this.lineStream.push("\n");this.trigger("end")}addParser(t){this.parseStream.addParser(t)}addTagMapper(t){this.parseStream.addTagMapper(t)}}var Ot={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 Lt=["video","audio","text"];var Rt=["Video","Audio","Text"];var $t=function t(e){if(!e){return e}return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(t,e,i){var s=("00"+Number(e).toString(16)).slice(-2);var n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+s+"00"+n}))};var Pt=function t(e){if(e===void 0){e=""}var i=e.split(",");var s=[];i.forEach((function(t){t=t.trim();var e;Lt.forEach((function(i){var n=Ot[i].exec(t.toLowerCase());if(!n||n.length<=1){return}e=i;var r=t.substring(0,n[1].length);var o=t.replace(r,"");s.push({type:r,details:o,mediaType:i})}));if(!e){s.push({type:t,details:"",mediaType:"unknown"})}}));return s};var Ut=function t(e,i){if(!e.mediaGroups.AUDIO||!i){return null}var s=e.mediaGroups.AUDIO[i];if(!s){return null}for(var n in s){var r=s[n];if(r.default&&r.playlists){return Pt(r.playlists[0].attributes.CODECS)}}return null};var Ft=function t(e){if(e===void 0){e=""}return Ot.audio.test(e.trim().toLowerCase())};var Bt=function t(e){if(e===void 0){e=""}return Ot.text.test(e.trim().toLowerCase())};var qt=function t(e){if(!e||typeof e!=="string"){return}var i=e.toLowerCase().split(",").map((function(t){return $t(t.trim())}));var s="video";if(i.length===1&&Ft(i[0])){s="audio"}else if(i.length===1&&Bt(i[0])){s="application"}var n="mp4";if(i.every((function(t){return Ot.mp4.test(t)}))){n="mp4"}else if(i.every((function(t){return Ot.webm.test(t)}))){n="webm"}else if(i.every((function(t){return Ot.ogg.test(t)}))){n="ogg"}return s+"/"+n+';codecs="'+e+'"'};var Vt=function t(e){if(e===void 0){e=""}return o.MediaSource&&o.MediaSource.isTypeSupported&&o.MediaSource.isTypeSupported(qt(e))||false};var Ht=function t(e){if(e===void 0){e=""}return e.toLowerCase().split(",").every((function(t){t=t.trim();for(var e=0;e<Rt.length;e++){var i=Rt[e];if(Ot["muxer"+i].test(t)){return true}}return false}))};var zt="mp4a.40.2";var Xt="avc1.4d400d";var Gt=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;var Wt=/^application\/dash\+xml/i;var Yt=function t(e){if(Gt.test(e)){return"hls"}if(Wt.test(e)){return"dash"}if(e==="application/vnd.videojs.vhs+json"){return"vhs-json"}return null};var Kt=function t(e){return e.toString(2).length};var Qt=function t(e){return Math.ceil(Kt(e)/8)};var Jt=function t(e){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(e)}return e&&e.buffer instanceof ArrayBuffer};var Zt=function t(e){return Jt(e)};var te=function t(e){if(e instanceof Uint8Array){return e}if(!Array.isArray(e)&&!Zt(e)&&!(e instanceof ArrayBuffer)){if(typeof e!=="number"||typeof e==="number"&&e!==e){e=0}else{e=[e]}}return new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0)};var ee=o.BigInt||Number;var ie=[ee("0x1"),ee("0x100"),ee("0x10000"),ee("0x1000000"),ee("0x100000000"),ee("0x10000000000"),ee("0x1000000000000"),ee("0x100000000000000"),ee("0x10000000000000000")];var se=function t(e,i){var s=i===void 0?{}:i,n=s.signed,r=n===void 0?false:n,o=s.le,a=o===void 0?false:o;e=te(e);var h=a?"reduce":"reduceRight";var u=e[h]?e[h]:Array.prototype[h];var c=u.call(e,(function(t,i,s){var n=a?s:Math.abs(s+1-e.length);return t+ee(i)*ie[n]}),ee(0));if(r){var f=ie[e.length]/ee(2)-ee(1);c=ee(c);if(c>f){c-=f;c-=f;c-=ee(2)}}return Number(c)};var ne=function t(e,i){var s=i===void 0?{}:i,n=s.le,r=n===void 0?false:n;if(typeof e!=="bigint"&&typeof e!=="number"||typeof e==="number"&&e!==e){e=0}e=ee(e);var o=Qt(e);var a=new Uint8Array(new ArrayBuffer(o));for(var h=0;h<o;h++){var u=r?h:Math.abs(h+1-a.length);a[u]=Number(e/ie[h]&ee(255));if(e<0){a[u]=Math.abs(~a[u]);a[u]-=h===0?1:2}}return a};var re=function t(e,i){if(typeof e!=="string"&&e&&typeof e.toString==="function"){e=e.toString()}if(typeof e!=="string"){return new Uint8Array}if(!i){e=unescape(encodeURIComponent(e))}var s=new Uint8Array(e.length);for(var n=0;n<e.length;n++){s[n]=e.charCodeAt(n)}return s};var oe=function t(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++){i[s]=arguments[s]}i=i.filter((function(t){return t&&(t.byteLength||t.length)&&typeof t!=="string"}));if(i.length<=1){return te(i[0])}var n=i.reduce((function(t,e,i){return t+(e.byteLength||e.length)}),0);var r=new Uint8Array(n);var o=0;i.forEach((function(t){t=te(t);r.set(t,o);o+=t.byteLength}));return r};var ae=function t(e,i,s){var n=s===void 0?{}:s,r=n.offset,o=r===void 0?0:r,a=n.mask,h=a===void 0?[]:a;e=te(e);i=te(i);var u=i.every?i.every:Array.prototype.every;return i.length&&e.length-o>=i.length&&u.call(i,(function(t,i){var s=h[i]?h[i]&e[o+i]:e[o+i];return t===s}))};var he="http://example.com";var ue=function t(e,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(e)){e=o.location&&o.location.href||""}var s=typeof o.URL==="function";var n=/^\/\//.test(e);var r=!o.location&&!/\/\//i.test(e);if(s){e=new o.URL(e,o.location||he)}else if(!/\/\//i.test(e)){e=yt.buildAbsoluteURL(o.location&&o.location.href||"",e)}if(s){var a=new URL(i,e);if(r){return a.href.slice(he.length)}else if(n){return a.href.slice(a.protocol.length)}return a.href}return yt.buildAbsoluteURL(e,i)};var ce=function t(e,i,s){i.forEach((function(t){for(var i in e.mediaGroups[t]){for(var n in e.mediaGroups[t][i]){var r=e.mediaGroups[t][i][n];s(r,t,i,n)}}}))};var fe=function t(e){return o.atob?o.atob(e):Buffer.from(e,"base64").toString("binary")};function le(t){var e=fe(t);var i=new Uint8Array(e.length);for(var s=0;s<e.length;s++){i[s]=e.charCodeAt(s)}return i}function de(t,e,i){if(i===undefined){i=Array.prototype}if(t&&typeof i.find==="function"){return i.find.call(t,e)}for(var s=0;s<t.length;s++){if(Object.prototype.hasOwnProperty.call(t,s)){var n=t[s];if(e.call(undefined,n,s,t)){return n}}}}function pe(t,e){if(e===undefined){e=Object}return e&&typeof e.freeze==="function"?e.freeze(t):t}function me(t,e){if(t===null||typeof t!=="object"){throw new TypeError("target is not an object")}for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t[i]=e[i]}}return t}var ve=pe({HTML:"text/html",isHTML:function(t){return t===ve.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"});var ge=pe({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===ge.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});var ye=me;var be=de;var we=pe;var Te=ve;var Se=ge;var ke={assign:ye,find:be,freeze:we,MIME_TYPE:Te,NAMESPACE:Se};var Ee=ke.find;var Ie=ke.NAMESPACE;function xe(t){return t!==""}function Ae(t){return t?t.split(/[\t\n\f\r ]+/).filter(xe):[]}function De(t,e){if(!t.hasOwnProperty(e)){t[e]=true}return t}function Ce(t){if(!t)return[];var e=Ae(t);return Object.keys(e.reduce(De,{}))}function je(t){return function(e){return t&&t.indexOf(e)!==-1}}function _e(t,e){for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){e[i]=t[i]}}}function Ne(t,e){var i=t.prototype;if(!(i instanceof e)){function s(){}s.prototype=e.prototype;s=new s;_e(i,s);t.prototype=i=s}if(i.constructor!=t){if(typeof t!="function"){console.error("unknown Class:"+t)}i.constructor=t}}var Me={};var Oe=Me.ELEMENT_NODE=1;var Le=Me.ATTRIBUTE_NODE=2;var Re=Me.TEXT_NODE=3;var $e=Me.CDATA_SECTION_NODE=4;var Pe=Me.ENTITY_REFERENCE_NODE=5;var Ue=Me.ENTITY_NODE=6;var Fe=Me.PROCESSING_INSTRUCTION_NODE=7;var Be=Me.COMMENT_NODE=8;var qe=Me.DOCUMENT_NODE=9;var Ve=Me.DOCUMENT_TYPE_NODE=10;var He=Me.DOCUMENT_FRAGMENT_NODE=11;var ze=Me.NOTATION_NODE=12;var Xe={};var Ge={};Xe.INDEX_SIZE_ERR=(Ge[1]="Index size error",1);Xe.DOMSTRING_SIZE_ERR=(Ge[2]="DOMString size error",2);var We=Xe.HIERARCHY_REQUEST_ERR=(Ge[3]="Hierarchy request error",3);Xe.WRONG_DOCUMENT_ERR=(Ge[4]="Wrong document",4);Xe.INVALID_CHARACTER_ERR=(Ge[5]="Invalid character",5);Xe.NO_DATA_ALLOWED_ERR=(Ge[6]="No data allowed",6);Xe.NO_MODIFICATION_ALLOWED_ERR=(Ge[7]="No modification allowed",7);var Ye=Xe.NOT_FOUND_ERR=(Ge[8]="Not found",8);Xe.NOT_SUPPORTED_ERR=(Ge[9]="Not supported",9);var Ke=Xe.INUSE_ATTRIBUTE_ERR=(Ge[10]="Attribute in use",10);Xe.INVALID_STATE_ERR=(Ge[11]="Invalid state",11);Xe.SYNTAX_ERR=(Ge[12]="Syntax error",12);Xe.INVALID_MODIFICATION_ERR=(Ge[13]="Invalid modification",13);Xe.NAMESPACE_ERR=(Ge[14]="Invalid namespace",14);Xe.INVALID_ACCESS_ERR=(Ge[15]="Invalid access",15);function Qe(t,e){if(e instanceof Error){var i=e}else{i=this;Error.call(this,Ge[t]);this.message=Ge[t];if(Error.captureStackTrace)Error.captureStackTrace(this,Qe)}i.code=t;if(e)this.message=this.message+": "+e;return i}Qe.prototype=Error.prototype;_e(Xe,Qe);function Je(){}Je.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var i=[],s=0;s<this.length;s++){qi(this[s],i,t,e)}return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}};function Ze(t,e){this._node=t;this._refresh=e;ti(this)}function ti(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);zi(t,"length",i.length);if(!t.$$length||i.length<t.$$length){for(var s=i.length;s in t;s++){if(Object.prototype.hasOwnProperty.call(t,s)){delete t[s]}}}_e(i,t);t._inc=e}}Ze.prototype.item=function(t){ti(this);return this[t]||null};Ne(Ze,Je);function ei(){}function ii(t,e){var i=t.length;while(i--){if(t[i]===e){return i}}}function si(t,e,i,s){if(s){e[ii(e,s)]=i}else{e[e.length++]=i}if(t){i.ownerElement=t;var n=t.ownerDocument;if(n){s&&fi(n,t,s);ci(n,t,i)}}}function ni(t,e,i){var s=ii(e,i);if(s>=0){var n=e.length-1;while(s<n){e[s]=e[++s]}e.length=n;if(t){var r=t.ownerDocument;if(r){fi(r,t,i);i.ownerElement=null}}}else{throw new Qe(Ye,new Error(t.tagName+"@"+i))}}ei.prototype={length:0,item:Je.prototype.item,getNamedItem:function(t){var e=this.length;while(e--){var i=this[e];if(i.nodeName==t){return i}}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement){throw new Qe(Ke)}var i=this.getNamedItem(t.nodeName);si(this._ownerElement,this,t,i);return i},setNamedItemNS:function(t){var e=t.ownerElement,i;if(e&&e!=this._ownerElement){throw new Qe(Ke)}i=this.getNamedItemNS(t.namespaceURI,t.localName);si(this._ownerElement,this,t,i);return i},removeNamedItem:function(t){var e=this.getNamedItem(t);ni(this._ownerElement,this,e);return e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);ni(this._ownerElement,this,i);return i},getNamedItemNS:function(t,e){var i=this.length;while(i--){var s=this[i];if(s.localName==e&&s.namespaceURI==t){return s}}return null}};function ri(){}ri.prototype={hasFeature:function(t,e){return true},createDocument:function(t,e,i){var s=new ui;s.implementation=this;s.childNodes=new Je;s.doctype=i||null;if(i){s.appendChild(i)}if(e){var n=s.createElementNS(t,e);s.appendChild(n)}return s},createDocumentType:function(t,e,i){var s=new Ni;s.name=t;s.nodeName=t;s.publicId=e||"";s.systemId=i||"";return s}};function oi(){}oi.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(t,e){return Ei(this,t,e)},replaceChild:function(t,e){Ei(this,t,e,ki);if(e){this.removeChild(e)}},removeChild:function(t){return di(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return Hi(this.ownerDocument||this,this,t)},normalize:function(){var t=this.firstChild;while(t){var e=t.nextSibling;if(e&&e.nodeType==Re&&t.nodeType==Re){this.removeChild(e);t.appendData(e.data)}else{t.normalize();t=e}}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){var e=this;while(e){var i=e._nsMap;if(i){for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===t){return s}}}e=e.nodeType==Le?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){var e=this;while(e){var i=e._nsMap;if(i){if(Object.prototype.hasOwnProperty.call(i,t)){return i[t]}}e=e.nodeType==Le?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function ai(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}_e(Me,oi);_e(Me,oi.prototype);function hi(t,e){if(e(t)){return true}if(t=t.firstChild){do{if(hi(t,e)){return true}}while(t=t.nextSibling)}}function ui(){this.ownerDocument=this}function ci(t,e,i){t&&t._inc++;var s=i.namespaceURI;if(s===Ie.XMLNS){e._nsMap[i.prefix?i.localName:""]=i.value}}function fi(t,e,i,s){t&&t._inc++;var n=i.namespaceURI;if(n===Ie.XMLNS){delete e._nsMap[i.prefix?i.localName:""]}}function li(t,e,i){if(t&&t._inc){t._inc++;var s=e.childNodes;if(i){s[s.length++]=i}else{var n=e.firstChild;var r=0;while(n){s[r++]=n;n=n.nextSibling}s.length=r;delete s[s.length]}}}function di(t,e){var i=e.previousSibling;var s=e.nextSibling;if(i){i.nextSibling=s}else{t.firstChild=s}if(s){s.previousSibling=i}else{t.lastChild=i}e.parentNode=null;e.previousSibling=null;e.nextSibling=null;li(t.ownerDocument,t);return e}function pi(t){return t&&(t.nodeType===oi.DOCUMENT_NODE||t.nodeType===oi.DOCUMENT_FRAGMENT_NODE||t.nodeType===oi.ELEMENT_NODE)}function mi(t){return t&&(gi(t)||yi(t)||vi(t)||t.nodeType===oi.DOCUMENT_FRAGMENT_NODE||t.nodeType===oi.COMMENT_NODE||t.nodeType===oi.PROCESSING_INSTRUCTION_NODE)}function vi(t){return t&&t.nodeType===oi.DOCUMENT_TYPE_NODE}function gi(t){return t&&t.nodeType===oi.ELEMENT_NODE}function yi(t){return t&&t.nodeType===oi.TEXT_NODE}function bi(t,e){var i=t.childNodes||[];if(Ee(i,gi)||vi(e)){return false}var s=Ee(i,vi);return!(e&&s&&i.indexOf(s)>i.indexOf(e))}function wi(t,e){var i=t.childNodes||[];function s(t){return gi(t)&&t!==e}if(Ee(i,s)){return false}var n=Ee(i,vi);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function Ti(t,e,i){if(!pi(t)){throw new Qe(We,"Unexpected parent node type "+t.nodeType)}if(i&&i.parentNode!==t){throw new Qe(Ye,"child not in parent")}if(!mi(e)||vi(e)&&t.nodeType!==oi.DOCUMENT_NODE){throw new Qe(We,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}}function Si(t,e,i){var s=t.childNodes||[];var n=e.childNodes||[];if(e.nodeType===oi.DOCUMENT_FRAGMENT_NODE){var r=n.filter(gi);if(r.length>1||Ee(n,yi)){throw new Qe(We,"More than one element or text in fragment")}if(r.length===1&&!bi(t,i)){throw new Qe(We,"Element in fragment can not be inserted before doctype")}}if(gi(e)){if(!bi(t,i)){throw new Qe(We,"Only one element can be added and only after doctype")}}if(vi(e)){if(Ee(s,vi)){throw new Qe(We,"Only one doctype is allowed")}var o=Ee(s,gi);if(i&&s.indexOf(o)<s.indexOf(i)){throw new Qe(We,"Doctype can only be inserted before an element")}if(!i&&o){throw new Qe(We,"Doctype can not be appended since element is present")}}}function ki(t,e,i){var s=t.childNodes||[];var n=e.childNodes||[];if(e.nodeType===oi.DOCUMENT_FRAGMENT_NODE){var r=n.filter(gi);if(r.length>1||Ee(n,yi)){throw new Qe(We,"More than one element or text in fragment")}if(r.length===1&&!wi(t,i)){throw new Qe(We,"Element in fragment can not be inserted before doctype")}}if(gi(e)){if(!wi(t,i)){throw new Qe(We,"Only one element can be added and only after doctype")}}if(vi(e)){function o(t){return vi(t)&&t!==i}if(Ee(s,o)){throw new Qe(We,"Only one doctype is allowed")}var a=Ee(s,gi);if(i&&s.indexOf(a)<s.indexOf(i)){throw new Qe(We,"Doctype can only be inserted before an element")}}}function Ei(t,e,i,s){Ti(t,e,i);if(t.nodeType===oi.DOCUMENT_NODE){(s||Si)(t,e,i)}var n=e.parentNode;if(n){n.removeChild(e)}if(e.nodeType===He){var r=e.firstChild;if(r==null){return e}var o=e.lastChild}else{r=o=e}var a=i?i.previousSibling:t.lastChild;r.previousSibling=a;o.nextSibling=i;if(a){a.nextSibling=r}else{t.firstChild=r}if(i==null){t.lastChild=o}else{i.previousSibling=o}do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));li(t.ownerDocument||t,t);if(e.nodeType==He){e.firstChild=e.lastChild=null}return e}function Ii(t,e){if(e.parentNode){e.parentNode.removeChild(e)}e.parentNode=t;e.previousSibling=t.lastChild;e.nextSibling=null;if(e.previousSibling){e.previousSibling.nextSibling=e}else{t.firstChild=e}t.lastChild=e;li(t.ownerDocument,t,e);return e}ui.prototype={nodeName:"#document",nodeType:qe,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==He){var i=t.firstChild;while(i){var s=i.nextSibling;this.insertBefore(i,e);i=s}return t}Ei(this,t,e);t.ownerDocument=this;if(this.documentElement===null&&t.nodeType===Oe){this.documentElement=t}return t},removeChild:function(t){if(this.documentElement==t){this.documentElement=null}return di(this,t)},replaceChild:function(t,e){Ei(this,t,e,ki);t.ownerDocument=this;if(e){this.removeChild(e)}if(gi(t)){this.documentElement=t}},importNode:function(t,e){return Vi(this,t,e)},getElementById:function(t){var e=null;hi(this.documentElement,(function(i){if(i.nodeType==Oe){if(i.getAttribute("id")==t){e=i;return true}}}));return e},getElementsByClassName:function(t){var e=Ce(t);return new Ze(this,(function(i){var s=[];if(e.length>0){hi(i.documentElement,(function(n){if(n!==i&&n.nodeType===Oe){var r=n.getAttribute("class");if(r){var o=t===r;if(!o){var a=Ce(r);o=e.every(je(a))}if(o){s.push(n)}}}}))}return s}))},createElement:function(t){var e=new xi;e.ownerDocument=this;e.nodeName=t;e.tagName=t;e.localName=t;e.childNodes=new Je;var i=e.attributes=new ei;i._ownerElement=e;return e},createDocumentFragment:function(){var t=new Ri;t.ownerDocument=this;t.childNodes=new Je;return t},createTextNode:function(t){var e=new Ci;e.ownerDocument=this;e.appendData(t);return e},createComment:function(t){var e=new ji;e.ownerDocument=this;e.appendData(t);return e},createCDATASection:function(t){var e=new _i;e.ownerDocument=this;e.appendData(t);return e},createProcessingInstruction:function(t,e){var i=new $i;i.ownerDocument=this;i.tagName=i.nodeName=i.target=t;i.nodeValue=i.data=e;return i},createAttribute:function(t){var e=new Ai;e.ownerDocument=this;e.name=t;e.nodeName=t;e.localName=t;e.specified=true;return e},createEntityReference:function(t){var e=new Li;e.ownerDocument=this;e.nodeName=t;return e},createElementNS:function(t,e){var i=new xi;var s=e.split(":");var n=i.attributes=new ei;i.childNodes=new Je;i.ownerDocument=this;i.nodeName=e;i.tagName=e;i.namespaceURI=t;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=e}n._ownerElement=i;return i},createAttributeNS:function(t,e){var i=new Ai;var s=e.split(":");i.ownerDocument=this;i.nodeName=e;i.name=e;i.namespaceURI=t;i.specified=true;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=e}return i}};Ne(ui,oi);function xi(){this._nsMap={}}xi.prototype={nodeType:Oe,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e;this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){if(t.nodeType===He){return this.insertBefore(t,null)}else{return Ii(this,t)}},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var s=this.ownerDocument.createAttributeNS(t,e);s.value=s.nodeValue=""+i;this.setAttributeNode(s)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new Ze(this,(function(e){var i=[];hi(e,(function(s){if(s!==e&&s.nodeType==Oe&&(t==="*"||s.tagName==t)){i.push(s)}}));return i}))},getElementsByTagNameNS:function(t,e){return new Ze(this,(function(i){var s=[];hi(i,(function(n){if(n!==i&&n.nodeType===Oe&&(t==="*"||n.namespaceURI===t)&&(e==="*"||n.localName==e)){s.push(n)}}));return s}))}};ui.prototype.getElementsByTagName=xi.prototype.getElementsByTagName;ui.prototype.getElementsByTagNameNS=xi.prototype.getElementsByTagNameNS;Ne(xi,oi);function Ai(){}Ai.prototype.nodeType=Le;Ne(Ai,oi);function Di(){}Di.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t;this.nodeValue=this.data=t;this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(Ge[We])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){var s=this.data.substring(0,t);var n=this.data.substring(t+e);i=s+i+n;this.nodeValue=this.data=i;this.length=i.length}};Ne(Di,oi);function Ci(){}Ci.prototype={nodeName:"#text",nodeType:Re,splitText:function(t){var e=this.data;var i=e.substring(t);e=e.substring(0,t);this.data=this.nodeValue=e;this.length=e.length;var s=this.ownerDocument.createTextNode(i);if(this.parentNode){this.parentNode.insertBefore(s,this.nextSibling)}return s}};Ne(Ci,Di);function ji(){}ji.prototype={nodeName:"#comment",nodeType:Be};Ne(ji,Di);function _i(){}_i.prototype={nodeName:"#cdata-section",nodeType:$e};Ne(_i,Di);function Ni(){}Ni.prototype.nodeType=Ve;Ne(Ni,oi);function Mi(){}Mi.prototype.nodeType=ze;Ne(Mi,oi);function Oi(){}Oi.prototype.nodeType=Ue;Ne(Oi,oi);function Li(){}Li.prototype.nodeType=Pe;Ne(Li,oi);function Ri(){}Ri.prototype.nodeName="#document-fragment";Ri.prototype.nodeType=He;Ne(Ri,oi);function $i(){}$i.prototype.nodeType=Fe;Ne($i,oi);function Pi(){}Pi.prototype.serializeToString=function(t,e,i){return Ui.call(t,e,i)};oi.prototype.toString=Ui;function Ui(t,e){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 o=[{namespace:r,prefix:null}]}}qi(this,i,t,e,o);return i.join("")}function Fi(t,e,i){var s=t.prefix||"";var n=t.namespaceURI;if(!n){return false}if(s==="xml"&&n===Ie.XML||n===Ie.XMLNS){return false}var r=i.length;while(r--){var o=i[r];if(o.prefix===s){return o.namespace!==n}}return true}function Bi(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,ai),'"')}function qi(t,e,i,s,n){if(!n){n=[]}if(s){t=s(t);if(t){if(typeof t=="string"){e.push(t);return}}else{return}}switch(t.nodeType){case Oe:var r=t.attributes;var o=r.length;var a=t.firstChild;var h=t.tagName;i=Ie.isHTML(t.namespaceURI)||i;var u=h;if(!i&&!t.prefix&&t.namespaceURI){var c;for(var f=0;f<r.length;f++){if(r.item(f).name==="xmlns"){c=r.item(f).value;break}}if(!c){for(var l=n.length-1;l>=0;l--){var d=n[l];if(d.prefix===""&&d.namespace===t.namespaceURI){c=d.namespace;break}}}if(c!==t.namespaceURI){for(var l=n.length-1;l>=0;l--){var d=n[l];if(d.namespace===t.namespaceURI){if(d.prefix){u=d.prefix+":"+h}break}}}}e.push("<",u);for(var p=0;p<o;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<o;p++){var m=r.item(p);if(Fi(m,i,n)){var v=m.prefix||"";var g=m.namespaceURI;Bi(e,v?"xmlns:"+v:"xmlns",g);n.push({prefix:v,namespace:g})}qi(m,e,i,s,n)}if(h===u&&Fi(t,i,n)){var v=t.prefix||"";var g=t.namespaceURI;Bi(e,v?"xmlns:"+v:"xmlns",g);n.push({prefix:v,namespace:g})}if(a||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){e.push(">");if(i&&/^script$/i.test(h)){while(a){if(a.data){e.push(a.data)}else{qi(a,e,i,s,n.slice())}a=a.nextSibling}}else{while(a){qi(a,e,i,s,n.slice());a=a.nextSibling}}e.push("</",u,">")}else{e.push("/>")}return;case qe:case He:var a=t.firstChild;while(a){qi(a,e,i,s,n.slice());a=a.nextSibling}return;case Le:return Bi(e,t.name,t.value);case Re:return e.push(t.data.replace(/[<&>]/g,ai));case $e:return e.push("<![CDATA[",t.data,"]]>");case Be:return e.push("\x3c!--",t.data,"--\x3e");case Ve:var y=t.publicId;var b=t.systemId;e.push("<!DOCTYPE ",t.name);if(y){e.push(" PUBLIC ",y);if(b&&b!="."){e.push(" ",b)}e.push(">")}else if(b&&b!="."){e.push(" SYSTEM ",b,">")}else{var w=t.internalSubset;if(w){e.push(" [",w,"]")}e.push(">")}return;case Fe:return e.push("<?",t.target," ",t.data,"?>");case Pe:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function Vi(t,e,i){var s;switch(e.nodeType){case Oe:s=e.cloneNode(false);s.ownerDocument=t;case He:break;case Le:i=true;break}if(!s){s=e.cloneNode(false)}s.ownerDocument=t;s.parentNode=null;if(i){var n=e.firstChild;while(n){s.appendChild(Vi(t,n,i));n=n.nextSibling}}return s}function Hi(t,e,i){var s=new e.constructor;for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(typeof r!="object"){if(r!=s[n]){s[n]=r}}}}if(e.childNodes){s.childNodes=new Je}s.ownerDocument=t;switch(s.nodeType){case Oe:var o=e.attributes;var a=s.attributes=new ei;var h=o.length;a._ownerElement=s;for(var u=0;u<h;u++){s.setAttributeNode(Hi(t,o.item(u),true))}break;case Le:i=true}if(i){var c=e.firstChild;while(c){s.appendChild(Hi(t,c,i));c=c.nextSibling}}return s}function zi(t,e,i){t[e]=i}try{if(Object.defineProperty){Object.defineProperty(Ze.prototype,"length",{get:function(){ti(this);return this.$$length}});Object.defineProperty(oi.prototype,"textContent",{get:function(){return Xi(this)},set:function(t){switch(this.nodeType){case Oe:case He:while(this.firstChild){this.removeChild(this.firstChild)}if(t||String(t)){this.appendChild(this.ownerDocument.createTextNode(t))}break;default:this.data=t;this.value=t;this.nodeValue=t}}});function Xi(t){switch(t.nodeType){case Oe:case He:var e=[];t=t.firstChild;while(t){if(t.nodeType!==7&&t.nodeType!==8){e.push(Xi(t))}t=t.nextSibling}return e.join("");default:return t.nodeValue}}zi=function(t,e,i){t["$$"+e]=i}}}catch(rg){}var Gi=Ni;var Wi=Qe;var Yi=ri;var Ki=xi;var Qi=oi;var Ji=Je;var Zi=Pi;var ts={DocumentType:Gi,DOMException:Wi,DOMImplementation:Yi,Element:Ki,Node:Qi,NodeList:Ji,XMLSerializer:Zi};var es=i((function(t,e){var i=ke.freeze;e.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});e.HTML_ENTITIES=i({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""});e.entityMap=e.HTML_ENTITIES}));var is=ke.NAMESPACE;var ss=/[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 ns=new RegExp("[\\-\\.0-9"+ss.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var rs=new RegExp("^"+ss.source+ns.source+"*(?::"+ss.source+ns.source+"*)?$");var os=0;var as=1;var hs=2;var us=3;var cs=4;var fs=5;var ls=6;var ds=7;function ps(t,e){this.message=t;this.locator=e;if(Error.captureStackTrace)Error.captureStackTrace(this,ps)}ps.prototype=new Error;ps.prototype.name=ps.name;function ms(){}ms.prototype={parse:function(t,e,i){var s=this.domBuilder;s.startDocument();Ss(e,e={});vs(t,e,i,s,this.errorHandler);s.endDocument()}};function vs(t,e,i,s,n){function r(t){if(t>65535){t-=65536;var e=55296+(t>>10),i=56320+(t&1023);return String.fromCharCode(e,i)}else{return String.fromCharCode(t)}}function o(t){var e=t.slice(1,-1);if(Object.hasOwnProperty.call(i,e)){return i[e]}else if(e.charAt(0)==="#"){return r(parseInt(e.substr(1).replace("x","0x")))}else{n.error("entity not found:"+t);return t}}function a(e){if(e>m){var i=t.substring(m,e).replace(/&#?\w+;/g,o);l&&h(m);s.characters(i,0,e-m);m=e}}function h(e,i){while(e>=c&&(i=f.exec(t))){u=i.index;c=u+i[0].length;l.lineNumber++}l.columnNumber=e-u+1}var u=0;var c=0;var f=/.*(?:\r\n?|\n)|.*$/g;var l=s.locator;var d=[{currentNSMap:e}];var p={};var m=0;while(true){try{var v=t.indexOf("<",m);if(v<0){if(!t.substr(m).match(/^\s*$/)){var g=s.doc;var y=g.createTextNode(t.substr(m));g.appendChild(y);s.currentElement=y}return}if(v>m){a(v)}switch(t.charAt(v+1)){case"/":var b=t.indexOf(">",v+3);var w=t.substring(v+2,b).replace(/[ \t\n\r]+$/g,"");var T=d.pop();if(b<0){w=t.substring(v+2).replace(/[\s<].*/,"");n.error("end tag name: "+w+" is not complete:"+T.tagName);b=v+1+w.length}else if(w.match(/\s</)){w=w.replace(/[\s<].*/,"");n.error("end tag name: "+w+" maybe not complete");b=v+1+w.length}var S=T.localNSMap;var k=T.tagName==w;var E=k||T.tagName&&T.tagName.toLowerCase()==w.toLowerCase();if(E){s.endElement(T.uri,T.localName,w);if(S){for(var I in S){if(Object.prototype.hasOwnProperty.call(S,I)){s.endPrefixMapping(I)}}}if(!k){n.fatalError("end tag name: "+w+" is not match the current start tagName:"+T.tagName)}}else{d.push(T)}b++;break;case"?":l&&h(v);b=Es(t,v,s);break;case"!":l&&h(v);b=ks(t,v,s,n);break;default:l&&h(v);var x=new Is;var A=d[d.length-1].currentNSMap;var b=ys(t,v,x,A,o,n);var D=x.length;if(!x.closed&&Ts(t,b,x.tagName,p)){x.closed=true;if(!i.nbsp){n.warning("unclosed xml attribute")}}if(l&&D){var C=gs(l,{});for(var j=0;j<D;j++){var _=x[j];h(_.offset);_.locator=gs(l,{})}s.locator=C;if(bs(x,s,A)){d.push(x)}s.locator=l}else{if(bs(x,s,A)){d.push(x)}}if(is.isHTML(x.uri)&&!x.closed){b=ws(t,b,x.tagName,o,s)}else{b++}}}catch(t){if(t instanceof ps){throw t}n.error("element parse error: "+t);b=-1}if(b>m){m=b}else{a(Math.max(v,m)+1)}}}function gs(t,e){e.lineNumber=t.lineNumber;e.columnNumber=t.columnNumber;return e}function ys(t,e,i,s,n,r){function o(t,e,s){if(i.attributeNames.hasOwnProperty(t)){r.fatalError("Attribute "+t+" redefined")}i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),s)}var a;var h;var u=++e;var c=os;while(true){var f=t.charAt(u);switch(f){case"=":if(c===as){a=t.slice(e,u);c=us}else if(c===hs){c=us}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(c===us||c===as){if(c===as){r.warning('attribute value must after "="');a=t.slice(e,u)}e=u+1;u=t.indexOf(f,e);if(u>0){h=t.slice(e,u);o(a,h,e-1);c=fs}else{throw new Error("attribute value no end '"+f+"' match")}}else if(c==cs){h=t.slice(e,u);o(a,h,e);r.warning('attribute "'+a+'" missed start quot('+f+")!!");e=u+1;c=fs}else{throw new Error('attribute value must after "="')}break;case"/":switch(c){case os:i.setTagName(t.slice(e,u));case fs:case ls:case ds:c=ds;i.closed=true;case cs:case as:break;case hs:i.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":r.error("unexpected end of input");if(c==os){i.setTagName(t.slice(e,u))}return u;case">":switch(c){case os:i.setTagName(t.slice(e,u));case fs:case ls:case ds:break;case cs:case as:h=t.slice(e,u);if(h.slice(-1)==="/"){i.closed=true;h=h.slice(0,-1)}case hs:if(c===hs){h=a}if(c==cs){r.warning('attribute "'+h+'" missed quot(")!');o(a,h,e)}else{if(!is.isHTML(s[""])||!h.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!')}o(h,h,e)}break;case us:throw new Error("attribute value missed!!")}return u;case"":f=" ";default:if(f<=" "){switch(c){case os:i.setTagName(t.slice(e,u));c=ls;break;case as:a=t.slice(e,u);c=hs;break;case cs:var h=t.slice(e,u);r.warning('attribute "'+h+'" missed quot(")!!');o(a,h,e);case fs:c=ls;break}}else{switch(c){case hs:if(!is.isHTML(s[""])||!a.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!')}o(a,a,e);e=u;c=as;break;case fs:r.warning('attribute space is required"'+a+'"!!');case ls:c=as;e=u;break;case us:c=cs;e=u;break;case ds:throw new Error("elements closed character '/' and '>' must be connected to")}}}u++}}function bs(t,e,i){var s=t.tagName;var n=null;var r=t.length;while(r--){var o=t[r];var a=o.qName;var h=o.value;var u=a.indexOf(":");if(u>0){var c=o.prefix=a.slice(0,u);var f=a.slice(u+1);var l=c==="xmlns"&&f}else{f=a;c=null;l=a==="xmlns"&&""}o.localName=f;if(l!==false){if(n==null){n={};Ss(i,i={})}i[l]=n[l]=h;o.uri=is.XMLNS;e.startPrefixMapping(l,h)}}var r=t.length;while(r--){o=t[r];var c=o.prefix;if(c){if(c==="xml"){o.uri=is.XML}if(c!=="xmlns"){o.uri=i[c||""]}}}var u=s.indexOf(":");if(u>0){c=t.prefix=s.slice(0,u);f=t.localName=s.slice(u+1)}else{c=null;f=t.localName=s}var d=t.uri=i[c||""];e.startElement(d,f,s,t);if(t.closed){e.endElement(d,f,s);if(n){for(c in n){if(Object.prototype.hasOwnProperty.call(n,c)){e.endPrefixMapping(c)}}}}else{t.currentNSMap=i;t.localNSMap=n;return true}}function ws(t,e,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=t.indexOf("</"+i+">",e);var o=t.substring(e+1,r);if(/[&<]/.test(o)){if(/^script$/i.test(i)){n.characters(o,0,o.length);return r}o=o.replace(/&#?\w+;/g,s);n.characters(o,0,o.length);return r}}return e+1}function Ts(t,e,i,s){var n=s[i];if(n==null){n=t.lastIndexOf("</"+i+">");if(n<e){n=t.lastIndexOf("</"+i)}s[i]=n}return n<e}function Ss(t,e){for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){e[i]=t[i]}}}function ks(t,e,i,s){var n=t.charAt(e+2);switch(n){case"-":if(t.charAt(e+3)==="-"){var r=t.indexOf("--\x3e",e+4);if(r>e){i.comment(t,e+4,r-e-4);return r+3}else{s.error("Unclosed comment");return-1}}else{return-1}default:if(t.substr(e+3,6)=="CDATA["){var r=t.indexOf("]]>",e+9);i.startCDATA();i.characters(t,e+9,r-e-9);i.endCDATA();return r+3}var o=xs(t,e);var a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var h=o[1][0];var u=false;var c=false;if(a>3){if(/^public$/i.test(o[2][0])){u=o[3][0];c=a>4&&o[4][0]}else if(/^system$/i.test(o[2][0])){c=o[3][0]}}var f=o[a-1];i.startDTD(h,u,c);i.endDTD();return f.index+f[0].length}}return-1}function Es(t,e,i){var s=t.indexOf("?>",e);if(s){var n=t.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){i.processingInstruction(n[1],n[2]);return s+2}else{return-1}}return-1}function Is(){this.attributeNames={}}Is.prototype={setTagName:function(t){if(!rs.test(t)){throw new Error("invalid tagName:"+t)}this.tagName=t},addValue:function(t,e,i){if(!rs.test(t)){throw new Error("invalid attribute:"+t)}this.attributeNames[t]=this.length;this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function xs(t,e){var i;var s=[];var n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;n.lastIndex=e;n.exec(t);while(i=n.exec(t)){s.push(i);if(i[1])return s}}var As=ms;var Ds=ps;var Cs={XMLReader:As,ParseError:Ds};var js=ts.DOMImplementation;var _s=ke.NAMESPACE;var Ns=Cs.ParseError;var Ms=Cs.XMLReader;function Os(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Ls(t){this.options=t||{locator:{}}}Ls.prototype.parseFromString=function(t,e){var i=this.options;var s=new Ms;var n=i.domBuilder||new $s;var r=i.errorHandler;var o=i.locator;var a=i.xmlns||{};var h=/\/x?html?$/.test(e);var u=h?es.HTML_ENTITIES:es.XML_ENTITIES;if(o){n.setDocumentLocator(o)}s.errorHandler=Rs(r,n,o);s.domBuilder=i.domBuilder||n;if(h){a[""]=_s.HTML}a.xml=a.xml||_s.XML;var c=i.normalizeLineEndings||Os;if(t&&typeof t==="string"){s.parse(c(t),a,u)}else{s.errorHandler.error("invalid doc source")}return n.doc};function Rs(t,e,i){if(!t){if(e instanceof $s){return e}t=e}var s={};var n=t instanceof Function;i=i||{};function r(e){var r=t[e];if(!r&&n){r=t.length==2?function(i){t(e,i)}:t}s[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+Us(i))}||function(){}}r("warning");r("error");r("fatalError");return s}function $s(){this.cdata=false}function Ps(t,e){e.lineNumber=t.lineNumber;e.columnNumber=t.columnNumber}$s.prototype={startDocument:function(){this.doc=(new js).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(t,e,i,s){var n=this.doc;var r=n.createElementNS(t,i||e);var o=s.length;Bs(this,r);this.currentElement=r;this.locator&&Ps(this.locator,r);for(var a=0;a<o;a++){var t=s.getURI(a);var h=s.getValue(a);var i=s.getQName(a);var u=n.createAttributeNS(t,i);this.locator&&Ps(s.getLocator(a),u);u.value=u.nodeValue=h;r.setAttributeNode(u)}},endElement:function(t,e,i){var s=this.currentElement;this.currentElement=s.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&Ps(this.locator,i);Bs(this,i)},ignorableWhitespace:function(t,e,i){},characters:function(t,e,i){t=Fs.apply(this,arguments);if(t){if(this.cdata){var s=this.doc.createCDATASection(t)}else{var s=this.doc.createTextNode(t)}if(this.currentElement){this.currentElement.appendChild(s)}else if(/^\s*$/.test(t)){this.doc.appendChild(s)}this.locator&&Ps(this.locator,s)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){if(this.locator=t){t.lineNumber=0}},comment:function(t,e,i){t=Fs.apply(this,arguments);var s=this.doc.createComment(t);this.locator&&Ps(this.locator,s);Bs(this,s)},startCDATA:function(){this.cdata=true},endCDATA:function(){this.cdata=false},startDTD:function(t,e,i){var s=this.doc.implementation;if(s&&s.createDocumentType){var n=s.createDocumentType(t,e,i);this.locator&&Ps(this.locator,n);Bs(this,n);this.doc.doctype=n}},warning:function(t){console.warn("[xmldom warning]\t"+t,Us(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,Us(this.locator))},fatalError:function(t){throw new Ns(t,this.locator)}};function Us(t){if(t){return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}}function Fs(t,e,i){if(typeof t=="string"){return t.substr(e,i)}else{if(t.length>=e+i||e){return new java.lang.String(t,e,i)+""}return t}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){$s.prototype[t]=function(){return null}}));function Bs(t,e){if(!t.currentElement){t.doc.appendChild(e)}else{t.currentElement.appendChild(e)}}var qs=$s;var Vs=Os;var Hs=Ls;var zs={__DOMHandler:qs,normalizeLineEndings:Vs,DOMParser:Hs};var Xs=zs.DOMParser;
|
|
13
|
+
/*! @name mpd-parser @version 1.2.2 @license Apache-2.0 */const Gs=t=>!!t&&typeof t==="object";const Ws=(...t)=>t.reduce(((t,e)=>{if(typeof e!=="object"){return t}Object.keys(e).forEach((i=>{if(Array.isArray(t[i])&&Array.isArray(e[i])){t[i]=t[i].concat(e[i])}else if(Gs(t[i])&&Gs(e[i])){t[i]=Ws(t[i],e[i])}else{t[i]=e[i]}}));return t}),{});const Ys=t=>Object.keys(t).map((e=>t[e]));const Ks=(t,e)=>{const i=[];for(let s=t;s<e;s++){i.push(s)}return i};const Qs=t=>t.reduce(((t,e)=>t.concat(e)),[]);const Js=t=>{if(!t.length){return[]}const e=[];for(let i=0;i<t.length;i++){e.push(t[i])}return e};const Zs=(t,e)=>t.reduce(((t,i,s)=>{if(i[e]){t.push(s)}return t}),[]);const tn=(t,e)=>Ys(t.reduce(((t,i)=>{i.forEach((i=>{t[e(i)]=i}));return t}),{}));var en={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 sn=({baseUrl:t="",source:e="",range:i="",indexRange:s=""})=>{const n={uri:e,resolvedUri:ue(t||"",e)};if(i||s){const t=i?i:s;const e=t.split("-");let r=o.BigInt?o.BigInt(e[0]):parseInt(e[0],10);let a=o.BigInt?o.BigInt(e[1]):parseInt(e[1],10);if(r<Number.MAX_SAFE_INTEGER&&typeof r==="bigint"){r=Number(r)}if(a<Number.MAX_SAFE_INTEGER&&typeof a==="bigint"){a=Number(a)}let h;if(typeof a==="bigint"||typeof r==="bigint"){h=o.BigInt(a)-o.BigInt(r)+o.BigInt(1)}else{h=a-r+1}if(typeof h==="bigint"&&h<Number.MAX_SAFE_INTEGER){h=Number(h)}n.byterange={length:h,offset:r}}return n};const nn=t=>{let e;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){e=o.BigInt(t.offset)+o.BigInt(t.length)-o.BigInt(1)}else{e=t.offset+t.length-1}return`${t.offset}-${e}`};const rn=t=>{if(t&&typeof t!=="number"){t=parseInt(t,10)}if(isNaN(t)){return null}return t};const on={static(t){const{duration:e,timescale:i=1,sourceDuration:s,periodDuration:n}=t;const r=rn(t.endNumber);const o=e/i;if(typeof r==="number"){return{start:0,end:r}}if(typeof n==="number"){return{start:0,end:n/o}}return{start:0,end:s/o}},dynamic(t){const{NOW:e,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:o=0,minimumUpdatePeriod:a=0,timeShiftBufferDepth:h=Infinity}=t;const u=rn(t.endNumber);const c=(e+i)/1e3;const f=s+o;const l=c+a;const d=l-f;const p=Math.ceil(d*n/r);const m=Math.floor((c-f-h)*n/r);const v=Math.floor((c-f)*n/r);return{start:Math.max(0,m),end:typeof u==="number"?u:Math.min(p,v)}}};const an=t=>e=>{const{duration:i,timescale:s=1,periodStart:n,startNumber:r=1}=t;return{number:r+e,duration:i/s,timeline:n,time:e*i}};const hn=t=>{const{type:e,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=t;const{start:o,end:a}=on[e](t);const h=Ks(o,a).map(an(t));if(e==="static"){const t=h.length-1;const e=typeof n==="number"?n:r;h[t].duration=e-i/s*t}return h};const un=t=>{const{baseUrl:e,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:o,number:a=0,duration:h}=t;if(!e){throw new Error(en.NO_BASE_URL)}const u=sn({baseUrl:e,source:i.sourceURL,range:i.range});const c=sn({baseUrl:e,source:e,indexRange:n});c.map=u;if(h){const e=hn(t);if(e.length){c.duration=e[0].duration;c.timeline=e[0].timeline}}else if(s){c.duration=s;c.timeline=r}c.presentationTime=o||r;c.number=a;return[c]};const cn=(t,e,i)=>{const s=t.sidx.map?t.sidx.map:null;const n=t.sidx.duration;const r=t.timeline||0;const a=t.sidx.byterange;const h=a.offset+a.length;const u=e.timescale;const c=e.references.filter((t=>t.referenceType!==1));const f=[];const l=t.endList?"static":"dynamic";const d=t.sidx.timeline;let p=d;let m=t.mediaSequence||0;let v;if(typeof e.firstOffset==="bigint"){v=o.BigInt(h)+e.firstOffset}else{v=h+e.firstOffset}for(let t=0;t<c.length;t++){const a=e.references[t];const h=a.referencedSize;const c=a.subsegmentDuration;let g;if(typeof v==="bigint"){g=v+o.BigInt(h)-o.BigInt(1)}else{g=v+h-1}const y=`${v}-${g}`;const b={baseUrl:i,timescale:u,timeline:r,periodStart:d,presentationTime:p,number:m,duration:c,sourceDuration:n,indexRange:y,type:l};const w=un(b)[0];if(s){w.map=s}f.push(w);if(typeof v==="bigint"){v+=o.BigInt(h)}else{v+=h}p+=c/u;m++}t.segments=f;return t};const fn=["AUDIO","SUBTITLES"];const ln=1/60;const dn=t=>tn(t,(({timeline:t})=>t)).sort(((t,e)=>t.timeline>e.timeline?1:-1));const pn=(t,e)=>{for(let i=0;i<t.length;i++){if(t[i].attributes.NAME===e){return t[i]}}return null};const mn=t=>{let e=[];ce(t,fn,((t,i,s,n)=>{e=e.concat(t.playlists||[])}));return e};const vn=({playlist:t,mediaSequence:e})=>{t.mediaSequence=e;t.segments.forEach(((e,i)=>{e.number=t.mediaSequence+i}))};const gn=({oldPlaylists:t,newPlaylists:e,timelineStarts:i})=>{e.forEach((e=>{e.discontinuitySequence=i.findIndex((function({timeline:t}){return t===e.timeline}));const s=pn(t,e.attributes.NAME);if(!s){return}if(e.sidx){return}const n=e.segments[0];const r=s.segments.findIndex((function(t){return Math.abs(t.presentationTime-n.presentationTime)<ln}));if(r===-1){vn({playlist:e,mediaSequence:s.mediaSequence+s.segments.length});e.segments[0].discontinuity=true;e.discontinuityStarts.unshift(0);if(!s.segments.length&&e.timeline>s.timeline||s.segments.length&&e.timeline>s.segments[s.segments.length-1].timeline){e.discontinuitySequence--}return}const o=s.segments[r];if(o.discontinuity&&!n.discontinuity){n.discontinuity=true;e.discontinuityStarts.unshift(0);e.discontinuitySequence--}vn({playlist:e,mediaSequence:s.segments[r].number})}))};const yn=({oldManifest:t,newManifest:e})=>{const i=t.playlists.concat(mn(t));const s=e.playlists.concat(mn(e));e.timelineStarts=dn([t.timelineStarts,e.timelineStarts]);gn({oldPlaylists:i,newPlaylists:s,timelineStarts:e.timelineStarts});return e};const bn=t=>t&&t.uri+"-"+nn(t.byterange);const wn=t=>{const e=t.reduce((function(t,e){if(!t[e.attributes.baseUrl]){t[e.attributes.baseUrl]=[]}t[e.attributes.baseUrl].push(e);return t}),{});let i=[];Object.values(e).forEach((t=>{const e=Ys(t.reduce(((t,e)=>{const i=e.attributes.id+(e.attributes.lang||"");if(!t[i]){t[i]=e;t[i].attributes.timelineStarts=[]}else{if(e.segments){if(e.segments[0]){e.segments[0].discontinuity=true}t[i].segments.push(...e.segments)}if(e.attributes.contentProtection){t[i].attributes.contentProtection=e.attributes.contentProtection}}t[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart});return t}),{}));i=i.concat(e)}));return i.map((t=>{t.discontinuityStarts=Zs(t.segments||[],"discontinuity");return t}))};const Tn=(t,e)=>{const i=bn(t.sidx);const s=i&&e[i]&&e[i].sidx;if(s){cn(t,s,t.sidx.resolvedUri)}return t};const Sn=(t,e={})=>{if(!Object.keys(e).length){return t}for(const i in t){t[i]=Tn(t[i],e)}return t};const kn=({attributes:t,segments:e,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},o)=>{const a={attributes:{NAME:t.id,BANDWIDTH:t.bandwidth,CODECS:t.codecs,["PROGRAM-ID"]:1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:t.timelineStarts,mediaSequence:s,segments:e};if(t.contentProtection){a.contentProtection=t.contentProtection}if(t.serviceLocation){a.attributes.serviceLocation=t.serviceLocation}if(i){a.sidx=i}if(o){a.attributes.AUDIO="audio";a.attributes.SUBTITLES="subs"}return a};const En=({attributes:t,segments:e,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{if(typeof e==="undefined"){e=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}];t.duration=t.sourceDuration}const r={NAME:t.id,BANDWIDTH:t.bandwidth,["PROGRAM-ID"]:1};if(t.codecs){r.CODECS=t.codecs}const o={attributes:r,uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:e};if(t.serviceLocation){o.attributes.serviceLocation=t.serviceLocation}return o};const In=(t,e={},i=false)=>{let s;const n=t.reduce(((t,n)=>{const r=n.attributes.role&&n.attributes.role.value||"";const o=n.attributes.lang||"";let a=n.attributes.label||"main";if(o&&!n.attributes.label){const t=r?` (${r})`:"";a=`${n.attributes.lang}${t}`}if(!t[a]){t[a]={language:o,autoselect:true,default:r==="main",playlists:[],uri:""}}const h=Tn(kn(n,i),e);t[a].playlists.push(h);if(typeof s==="undefined"&&r==="main"){s=n;s.default=true}return t}),{});if(!s){const t=Object.keys(n)[0];n[t].default=true}return n};const xn=(t,e={})=>t.reduce(((t,i)=>{const s=i.attributes.label||i.attributes.lang||"text";if(!t[s]){t[s]={language:s,default:false,autoselect:false,playlists:[],uri:""}}t[s].playlists.push(Tn(En(i),e));return t}),{});const An=t=>t.reduce(((t,e)=>{if(!e){return t}e.forEach((e=>{const{channel:i,language:s}=e;t[s]={autoselect:false,default:false,instreamId:i,language:s};if(e.hasOwnProperty("aspectRatio")){t[s].aspectRatio=e.aspectRatio}if(e.hasOwnProperty("easyReader")){t[s].easyReader=e.easyReader}if(e.hasOwnProperty("3D")){t[s]["3D"]=e["3D"]}}));return t}),{});const Dn=({attributes:t,segments:e,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:s,timelineStarts:t.timelineStarts,segments:e};if(t.frameRate){n.attributes["FRAME-RATE"]=t.frameRate}if(t.contentProtection){n.contentProtection=t.contentProtection}if(t.serviceLocation){n.attributes.serviceLocation=t.serviceLocation}if(i){n.sidx=i}return n};const Cn=({attributes:t})=>t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video";const jn=({attributes:t})=>t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio";const _n=({attributes:t})=>t.mimeType==="text/vtt"||t.contentType==="text";const Nn=(t,e)=>{t.forEach((t=>{t.mediaSequence=0;t.discontinuitySequence=e.findIndex((function({timeline:e}){return e===t.timeline}));if(!t.segments){return}t.segments.forEach(((t,e)=>{t.number=e}))}))};const Mn=t=>{if(!t){return[]}return Object.keys(t).reduce(((e,i)=>{const s=t[i];return e.concat(s.playlists)}),[])};const On=({dashPlaylists:t,locations:e,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!t.length){return{}}const{sourceDuration:o,type:a,suggestedPresentationDelay:h,minimumUpdatePeriod:u}=t[0].attributes;const c=wn(t.filter(Cn)).map(Dn);const f=wn(t.filter(jn));const l=wn(t.filter(_n));const d=t.map((t=>t.attributes.captionServices)).filter(Boolean);const p={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:o,playlists:Sn(c,s)};if(u>=0){p.minimumUpdatePeriod=u*1e3}if(e){p.locations=e}if(i){p.contentSteering=i}if(a==="dynamic"){p.suggestedPresentationDelay=h}if(r&&r.length>0){p.eventStream=r}const m=p.playlists.length===0;const v=f.length?In(f,s,m):null;const g=l.length?xn(l,s):null;const y=c.concat(Mn(v),Mn(g));const b=y.map((({timelineStarts:t})=>t));p.timelineStarts=dn(b);Nn(y,p.timelineStarts);if(v){p.mediaGroups.AUDIO.audio=v}if(g){p.mediaGroups.SUBTITLES.subs=g}if(d.length){p.mediaGroups["CLOSED-CAPTIONS"].cc=An(d)}if(n){return yn({oldManifest:n,newManifest:p})}return p};const Ln=(t,e,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:o=1,periodStart:a=0,minimumUpdatePeriod:h=0}=t;const u=(s+n)/1e3;const c=r+a;const f=u+h;const l=f-c;return Math.ceil((l*o-e)/i)};const Rn=(t,e)=>{const{type:i,minimumUpdatePeriod:s=0,media:n="",sourceDuration:r,timescale:o=1,startNumber:a=1,periodStart:h}=t;const u=[];let c=-1;for(let f=0;f<e.length;f++){const l=e[f];const d=l.d;const p=l.r||0;const m=l.t||0;if(c<0){c=m}if(m&&m>c){c=m}let v;if(p<0){const a=f+1;if(a===e.length){if(i==="dynamic"&&s>0&&n.indexOf("$Number$")>0){v=Ln(t,c,d)}else{v=(r*o-c)/d}}else{v=(e[a].t-c)/d}}else{v=p+1}const g=a+u.length+v;let y=a+u.length;while(y<g){u.push({number:y,duration:d/o,time:c,timeline:h});c+=d;y++}}return u};const $n=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;const Pn=t=>(e,i,s,n)=>{if(e==="$$"){return"$"}if(typeof t[i]==="undefined"){return e}const r=""+t[i];if(i==="RepresentationID"){return r}if(!s){n=1}else{n=parseInt(n,10)}if(r.length>=n){return r}return`${new Array(n-r.length+1).join("0")}${r}`};const Un=(t,e)=>t.replace($n,Pn(e));const Fn=(t,e)=>{if(!t.duration&&!e){return[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]}if(t.duration){return hn(t)}return Rn(t,e)};const Bn=(t,e)=>{const i={RepresentationID:t.id,Bandwidth:t.bandwidth||0};const{initialization:s={sourceURL:"",range:""}}=t;const n=sn({baseUrl:t.baseUrl,source:Un(s.sourceURL,i),range:s.range});const r=Fn(t,e);return r.map((e=>{i.Number=e.number;i.Time=e.time;const s=Un(t.media||"",i);const r=t.timescale||1;const o=t.presentationTimeOffset||0;const a=t.periodStart+(e.time-o)/r;const h={uri:s,timeline:e.timeline,duration:e.duration,resolvedUri:ue(t.baseUrl||"",s),map:n,number:e.number,presentationTime:a};return h}))};const qn=(t,e)=>{const{baseUrl:i,initialization:s={}}=t;const n=sn({baseUrl:i,source:s.sourceURL,range:s.range});const r=sn({baseUrl:i,source:e.media,range:e.mediaRange});r.map=n;return r};const Vn=(t,e)=>{const{duration:i,segmentUrls:s=[],periodStart:n}=t;if(!i&&!e||i&&e){throw new Error(en.SEGMENT_TIME_UNSPECIFIED)}const r=s.map((e=>qn(t,e)));let o;if(i){o=hn(t)}if(e){o=Rn(t,e)}const a=o.map(((e,i)=>{if(r[i]){const s=r[i];const o=t.timescale||1;const a=t.presentationTimeOffset||0;s.timeline=e.timeline;s.duration=e.duration;s.number=e.number;s.presentationTime=n+(e.time-a)/o;return s}})).filter((t=>t));return a};const Hn=({attributes:t,segmentInfo:e})=>{let i;let s;if(e.template){s=Bn;i=Ws(t,e.template)}else if(e.base){s=un;i=Ws(t,e.base)}else if(e.list){s=Vn;i=Ws(t,e.list)}const n={attributes:t};if(!s){return n}const r=s(i,e.segmentTimeline);if(i.duration){const{duration:t,timescale:e=1}=i;i.duration=t/e}else if(r.length){i.duration=r.reduce(((t,e)=>Math.max(t,Math.ceil(e.duration))),0)}else{i.duration=0}n.attributes=i;n.segments=r;if(e.base&&i.indexRange){n.sidx=r[0];n.segments=[]}return n};const zn=t=>t.map(Hn);const Xn=(t,e)=>Js(t.childNodes).filter((({tagName:t})=>t===e));const Gn=t=>t.textContent.trim();const Wn=t=>parseFloat(t.split("/").reduce(((t,e)=>t/e)));const Yn=t=>{const e=365*24*60*60;const i=30*24*60*60;const s=24*60*60;const n=60*60;const r=60;const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;const a=o.exec(t);if(!a){return 0}const[h,u,c,f,l,d]=a.slice(1);return parseFloat(h||0)*e+parseFloat(u||0)*i+parseFloat(c||0)*s+parseFloat(f||0)*n+parseFloat(l||0)*r+parseFloat(d||0)};const Kn=t=>{const e=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(e.test(t)){t+="Z"}return Date.parse(t)};const Qn={mediaPresentationDuration(t){return Yn(t)},availabilityStartTime(t){return Kn(t)/1e3},minimumUpdatePeriod(t){return Yn(t)},suggestedPresentationDelay(t){return Yn(t)},type(t){return t},timeShiftBufferDepth(t){return Yn(t)},start(t){return Yn(t)},width(t){return parseInt(t,10)},height(t){return parseInt(t,10)},bandwidth(t){return parseInt(t,10)},frameRate(t){return Wn(t)},startNumber(t){return parseInt(t,10)},timescale(t){return parseInt(t,10)},presentationTimeOffset(t){return parseInt(t,10)},duration(t){const e=parseInt(t,10);if(isNaN(e)){return Yn(t)}return e},d(t){return parseInt(t,10)},t(t){return parseInt(t,10)},r(t){return parseInt(t,10)},presentationTime(t){return parseInt(t,10)},DEFAULT(t){return t}};const Jn=t=>{if(!(t&&t.attributes)){return{}}return Js(t.attributes).reduce(((t,e)=>{const i=Qn[e.name]||Qn.DEFAULT;t[e.name]=i(e.value);return t}),{})};const Zn={"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"};const tr=(t,e)=>{if(!e.length){return t}return Qs(t.map((function(t){return e.map((function(e){const i=Gn(e);const s=ue(t.baseUrl,i);const n=Ws(Jn(e),{baseUrl:s});if(s!==i&&!n.serviceLocation&&t.serviceLocation){n.serviceLocation=t.serviceLocation}return n}))})))};const er=t=>{const e=Xn(t,"SegmentTemplate")[0];const i=Xn(t,"SegmentList")[0];const s=i&&Xn(i,"SegmentURL").map((t=>Ws({tag:"SegmentURL"},Jn(t))));const n=Xn(t,"SegmentBase")[0];const r=i||e;const o=r&&Xn(r,"SegmentTimeline")[0];const a=i||n||e;const h=a&&Xn(a,"Initialization")[0];const u=e&&Jn(e);if(u&&h){u.initialization=h&&Jn(h)}else if(u&&u.initialization){u.initialization={sourceURL:u.initialization}}const c={template:u,segmentTimeline:o&&Xn(o,"S").map((t=>Jn(t))),list:i&&Ws(Jn(i),{segmentUrls:s,initialization:Jn(h)}),base:n&&Ws(Jn(n),{initialization:Jn(h)})};Object.keys(c).forEach((t=>{if(!c[t]){delete c[t]}}));return c};const ir=(t,e,i)=>s=>{const n=Xn(s,"BaseURL");const r=tr(e,n);const o=Ws(t,Jn(s));const a=er(s);return r.map((t=>({segmentInfo:Ws(i,a),attributes:Ws(o,t)})))};const sr=t=>t.reduce(((t,e)=>{const i=Jn(e);if(i.schemeIdUri){i.schemeIdUri=i.schemeIdUri.toLowerCase()}const s=Zn[i.schemeIdUri];if(s){t[s]={attributes:i};const n=Xn(e,"cenc:pssh")[0];if(n){const e=Gn(n);t[s].pssh=e&&le(e)}}return t}),{});const nr=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map((t=>{let e;let i;i=t;if(/^CC\d=/.test(t)){[e,i]=t.split("=")}else if(/^CC\d$/.test(t)){e=t}return{channel:e,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((t=>{const e={channel:undefined,language:undefined,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[i,s=""]=t.split("=");e.channel=i;e.language=t;s.split(",").forEach((t=>{const[i,s]=t.split(":");if(i==="lang"){e.language=s}else if(i==="er"){e.easyReader=Number(s)}else if(i==="war"){e.aspectRatio=Number(s)}else if(i==="3D"){e["3D"]=Number(s)}}))}else{e.language=t}if(e.channel){e.channel="SERVICE"+e.channel}return e}))}};const rr=t=>Qs(Xn(t.node,"EventStream").map((e=>{const i=Jn(e);const s=i.schemeIdUri;return Xn(e,"Event").map((e=>{const n=Jn(e);const r=n.presentationTime||0;const o=i.timescale||1;const a=n.duration||0;const h=r/o+t.attributes.start;return{schemeIdUri:s,value:i.value,id:n.id,start:h,end:h+a/o,messageData:Gn(e)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))})));const or=(t,e,i)=>s=>{const n=Jn(s);const r=tr(e,Xn(s,"BaseURL"));const o=Xn(s,"Role")[0];const a={role:Jn(o)};let h=Ws(t,n,a);const u=Xn(s,"Accessibility")[0];const c=nr(Jn(u));if(c){h=Ws(h,{captionServices:c})}const f=Xn(s,"Label")[0];if(f&&f.childNodes.length){const t=f.childNodes[0].nodeValue.trim();h=Ws(h,{label:t})}const l=sr(Xn(s,"ContentProtection"));if(Object.keys(l).length){h=Ws(h,{contentProtection:l})}const d=er(s);const p=Xn(s,"Representation");const m=Ws(i,d);return Qs(p.map(ir(h,r,m)))};const ar=(t,e)=>(i,s)=>{const n=tr(e,Xn(i.node,"BaseURL"));const r=Ws(t,{periodStart:i.attributes.start});if(typeof i.attributes.duration==="number"){r.periodDuration=i.attributes.duration}const o=Xn(i.node,"AdaptationSet");const a=er(i.node);return Qs(o.map(or(r,n,a)))};const hr=(t,e)=>{if(t.length>1){e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"})}if(!t.length){return null}const i=Ws({serverURL:Gn(t[0])},Jn(t[0]));i.queryBeforeStart=i.queryBeforeStart==="true";return i};const ur=({attributes:t,priorPeriodAttributes:e,mpdType:i})=>{if(typeof t.start==="number"){return t.start}if(e&&typeof e.start==="number"&&typeof e.duration==="number"){return e.start+e.duration}if(!e&&i==="static"){return 0}return null};const cr=(t,e={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=e;const o=Xn(t,"Period");if(!o.length){throw new Error(en.INVALID_NUMBER_OF_PERIOD)}const a=Xn(t,"Location");const h=Jn(t);const u=tr([{baseUrl:i}],Xn(t,"BaseURL"));const c=Xn(t,"ContentSteering");h.type=h.type||"static";h.sourceDuration=h.mediaPresentationDuration||0;h.NOW=s;h.clientOffset=n;if(a.length){h.locations=a.map(Gn)}const f=[];o.forEach(((t,e)=>{const i=Jn(t);const s=f[e-1];i.start=ur({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:h.type});f.push({node:t,attributes:i})}));return{locations:h.locations,contentSteeringInfo:hr(c,r),representationInfo:Qs(f.map(ar(h,u))),eventStream:Qs(f.map(rr))}};const fr=t=>{if(t===""){throw new Error(en.DASH_EMPTY_MANIFEST)}const e=new Xs;let i;let s;try{i=e.parseFromString(t,"application/xml");s=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch(t){}if(!s||s&&s.getElementsByTagName("parsererror").length>0){throw new Error(en.DASH_INVALID_XML)}return s};const lr=t=>{const e=Xn(t,"UTCTiming")[0];if(!e){return null}const i=Jn(e);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(en.UNSUPPORTED_UTC_TIMING_SCHEME)}return i};const dr=(t,e={})=>{const i=cr(fr(t),e);const s=zn(i.representationInfo);return On({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:i.eventStream})};const pr=t=>lr(fr(t));var mr=Math.pow(2,32);var vr=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);var i;if(e.getBigUint64){i=e.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return e.getUint32(0)*mr+e.getUint32(4)};var gr={getUint64:vr,MAX_UINT32:mr};var yr=gr.getUint64;var br=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},s=12;if(i.version===0){i.earliestPresentationTime=e.getUint32(s);i.firstOffset=e.getUint32(s+4);s+=8}else{i.earliestPresentationTime=yr(t.subarray(s));i.firstOffset=yr(t.subarray(s+8));s+=16}s+=2;var n=e.getUint16(s);s+=2;for(;n>0;s+=12,n--){i.references.push({referenceType:(t[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(t[s+8]&128),sapType:(t[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455})}return i};var wr=br;var Tr=te([73,68,51]);var Sr=function t(e,i){if(i===void 0){i=0}e=te(e);var s=e[i+5];var n=e[i+6]<<21|e[i+7]<<14|e[i+8]<<7|e[i+9];var r=(s&16)>>4;if(r){return n+20}return n+10};var kr=function t(e,i){if(i===void 0){i=0}e=te(e);if(e.length-i<10||!ae(e,Tr,{offset:i})){return i}i+=Sr(e,i);return t(e,i)};var Er=function t(e){if(typeof e==="string"){return re(e)}if(typeof e==="number"){return e}return e};var Ir=function t(e){if(!Array.isArray(e)){return[Er(e)]}return e.map((function(t){return Er(t)}))};var xr=function t(e,i,s){if(s===void 0){s=false}i=Ir(i);e=te(e);var n=[];if(!i.length){return n}var r=0;while(r<e.length){var o=(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0;var a=e.subarray(r+4,r+8);if(o===0){break}var h=r+o;if(h>e.length){if(s){break}h=e.length}var u=e.subarray(r+8,h);if(ae(a,i[0])){if(i.length===1){n.push(u)}else{n.push.apply(n,t(u,i.slice(1),s))}}r=h}return n};var Ar={EBML:te([26,69,223,163]),DocType:te([66,130]),Segment:te([24,83,128,103]),SegmentInfo:te([21,73,169,102]),Tracks:te([22,84,174,107]),Track:te([174]),TrackNumber:te([215]),DefaultDuration:te([35,227,131]),TrackEntry:te([174]),TrackType:te([131]),FlagDefault:te([136]),CodecID:te([134]),CodecPrivate:te([99,162]),VideoTrack:te([224]),AudioTrack:te([225]),Cluster:te([31,67,182,117]),Timestamp:te([231]),TimestampScale:te([42,215,177]),BlockGroup:te([160]),BlockDuration:te([155]),Block:te([161]),SimpleBlock:te([163])};var Dr=[128,64,32,16,8,4,2,1];var Cr=function t(e){var i=1;for(var s=0;s<Dr.length;s++){if(e&Dr[s]){break}i++}return i};var jr=function t(e,i,s,n){if(s===void 0){s=true}if(n===void 0){n=false}var r=Cr(e[i]);var o=e.subarray(i,i+r);if(s){o=Array.prototype.slice.call(e,i,i+r);o[0]^=Dr[r-1]}return{length:r,value:se(o,{signed:n}),bytes:o}};var _r=function t(e){if(typeof e==="string"){return e.match(/.{1,2}/g).map((function(e){return t(e)}))}if(typeof e==="number"){return ne(e)}return e};var Nr=function t(e){if(!Array.isArray(e)){return[_r(e)]}return e.map((function(t){return _r(t)}))};var Mr=function t(e,i,s){if(s>=i.length){return i.length}var n=jr(i,s,false);if(ae(e.bytes,n.bytes)){return s}var r=jr(i,s+n.length);return t(e,i,s+r.length+r.value+n.length)};var Or=function t(e,i){i=Nr(i);e=te(e);var s=[];if(!i.length){return s}var n=0;while(n<e.length){var r=jr(e,n,false);var o=jr(e,n+r.length);var a=n+r.length+o.length;if(o.value===127){o.value=Mr(r,e,a);if(o.value!==e.length){o.value-=a}}var h=a+o.value>e.length?e.length:a+o.value;var u=e.subarray(a,h);if(ae(i[0],r.bytes)){if(i.length===1){s.push(u)}else{s=s.concat(t(u,i.slice(1)))}}var c=r.length+o.length+u.length;n+=c}return s};var Lr=te([0,0,0,1]);var Rr=te([0,0,1]);var $r=te([0,0,3]);var Pr=function t(e){var i=[];var s=1;while(s<e.length-2){if(ae(e.subarray(s,s+3),$r)){i.push(s+2);s++}s++}if(i.length===0){return e}var n=e.length-i.length;var r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=e[o]}return r};var Ur=function t(e,i,s,n){if(n===void 0){n=Infinity}e=te(e);s=[].concat(s);var r=0;var o;var a=0;while(r<e.length&&(a<n||o)){var h=void 0;if(ae(e.subarray(r),Lr)){h=4}else if(ae(e.subarray(r),Rr)){h=3}if(!h){r++;continue}a++;if(o){return Pr(e.subarray(o,r))}var u=void 0;if(i==="h264"){u=e[r+h]&31}else if(i==="h265"){u=e[r+h]>>1&63}if(s.indexOf(u)!==-1){o=r+h}r+=h+(i==="h264"?1:2)}return e.subarray(0,0)};var Fr=function t(e,i,s){return Ur(e,"h264",i,s)};var Br=function t(e,i,s){return Ur(e,"h265",i,s)};var qr={webm:te([119,101,98,109]),matroska:te([109,97,116,114,111,115,107,97]),flac:te([102,76,97,67]),ogg:te([79,103,103,83]),ac3:te([11,119]),riff:te([82,73,70,70]),avi:te([65,86,73]),wav:te([87,65,86,69]),"3gp":te([102,116,121,112,51,103]),mp4:te([102,116,121,112]),fmp4:te([115,116,121,112]),mov:te([102,116,121,112,113,116]),moov:te([109,111,111,118]),moof:te([109,111,111,102])};var Vr={aac:function t(e){var i=kr(e);return ae(e,[255,16],{offset:i,mask:[255,22]})},mp3:function t(e){var i=kr(e);return ae(e,[255,2],{offset:i,mask:[255,6]})},webm:function t(e){var i=Or(e,[Ar.EBML,Ar.DocType])[0];return ae(i,qr.webm)},mkv:function t(e){var i=Or(e,[Ar.EBML,Ar.DocType])[0];return ae(i,qr.matroska)},mp4:function t(e){if(Vr["3gp"](e)||Vr.mov(e)){return false}if(ae(e,qr.mp4,{offset:4})||ae(e,qr.fmp4,{offset:4})){return true}if(ae(e,qr.moof,{offset:4})||ae(e,qr.moov,{offset:4})){return true}},mov:function t(e){return ae(e,qr.mov,{offset:4})},"3gp":function t(e){return ae(e,qr["3gp"],{offset:4})},ac3:function t(e){var i=kr(e);return ae(e,qr.ac3,{offset:i})},ts:function t(e){if(e.length<189&&e.length>=1){return e[0]===71}var i=0;while(i+188<e.length&&i<188){if(e[i]===71&&e[i+188]===71){return true}i+=1}return false},flac:function t(e){var i=kr(e);return ae(e,qr.flac,{offset:i})},ogg:function t(e){return ae(e,qr.ogg)},avi:function t(e){return ae(e,qr.riff)&&ae(e,qr.avi,{offset:8})},wav:function t(e){return ae(e,qr.riff)&&ae(e,qr.wav,{offset:8})},h264:function t(e){return Fr(e,7,3).length},h265:function t(e){return Br(e,[32,33],3).length}};var Hr=Object.keys(Vr).filter((function(t){return t!=="ts"&&t!=="h264"&&t!=="h265"})).concat(["ts","h264","h265"]);Hr.forEach((function(t){var e=Vr[t];Vr[t]=function(t){return e(te(t))}}));var zr=Vr;var Xr=function t(e){e=te(e);for(var i=0;i<Hr.length;i++){var s=Hr[i];if(zr[s](e)){return s}}return""};var Gr=function t(e){return xr(e,["moof"]).length>0};var Wr=9e4,Yr,Kr,Qr,Jr,Zr,to,eo;Yr=function(t){return t*Wr};Kr=function(t,e){return t*e};Qr=function(t){return t/Wr};Jr=function(t,e){return t/e};Zr=function(t,e){return Yr(Jr(t,e))};to=function(t,e){return Kr(Qr(t),e)};eo=function(t,e,i){return Qr(i?t:t-e)};var io={ONE_SECOND_IN_TS:Wr,secondsToVideoTs:Yr,secondsToAudioTs:Kr,videoTsToSeconds:Qr,audioTsToSeconds:Jr,audioTsToVideoTs:Zr,videoTsToAudioTs:to,metadataTsToSeconds:eo};
|
|
14
|
+
/**
|
|
15
|
+
* @license
|
|
16
|
+
* Video.js 8.5.2 <http://videojs.com/>
|
|
17
|
+
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
18
|
+
* Available under Apache License Version 2.0
|
|
19
|
+
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
|
20
|
+
*
|
|
21
|
+
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
|
22
|
+
* Available under Apache License Version 2.0
|
|
23
|
+
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
24
|
+
*/var so="8.5.2";const no={};const ro=function(t,e){no[t]=no[t]||[];if(e){no[t]=no[t].concat(e)}return no[t]};const oo=function(t,e){ro(t,e)};const ao=function(t,e){const i=ro(t).indexOf(e);if(i<=-1){return false}no[t]=no[t].slice();no[t].splice(i,1);return true};const ho=function(t,e){ro(t,[].concat(e).map((e=>{const i=(...s)=>{ao(t,i);return e(...s)};return i})))};const uo={prefixed:true};const co=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]];const fo=co[0];let lo;for(let og=0;og<co.length;og++){if(co[og][1]in l){lo=co[og];break}}if(lo){for(let ag=0;ag<lo.length;ag++){uo[fo[ag]]=lo[ag]}uo.prefixed=lo[0]!==fo[0]}let po=[];const mo=(t,e)=>(i,s,n)=>{const r=e.levels[s];const a=new RegExp(`^(${r})$`);if(i!=="log"){n.unshift(i.toUpperCase()+":")}n.unshift(t+":");if(po){po.push([].concat(n));const t=po.length-1e3;po.splice(0,t>0?t:0)}if(!o.console){return}let h=o.console[i];if(!h&&i==="debug"){h=o.console.info||o.console.log}if(!h||!r||!a.test(i)){return}h[Array.isArray(n)?"apply":"call"](o.console,n)};function vo(t){let e="info";let i;const s=function(...t){i("log",e,t)};i=mo(t,s);s.createLogger=e=>vo(t+": "+e);s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:e};s.level=t=>{if(typeof t==="string"){if(!s.levels.hasOwnProperty(t)){throw new Error(`"${t}" in not a valid log level`)}e=t}return e};s.history=()=>po?[].concat(po):[];s.history.filter=t=>(po||[]).filter((e=>new RegExp(`.*${t}.*`).test(e[0])));s.history.clear=()=>{if(po){po.length=0}};s.history.disable=()=>{if(po!==null){po.length=0;po=null}};s.history.enable=()=>{if(po===null){po=[]}};s.error=(...t)=>i("error",e,t);s.warn=(...t)=>i("warn",e,t);s.debug=(...t)=>i("debug",e,t);return s}const go=vo("VIDEOJS");const yo=go.createLogger;const bo=Object.prototype.toString;const wo=function(t){return ko(t)?Object.keys(t):[]};function To(t,e){wo(t).forEach((i=>e(t[i],i)))}function So(t,e,i=0){return wo(t).reduce(((i,s)=>e(i,t[s],s)),i)}function ko(t){return!!t&&typeof t==="object"}function Eo(t){return ko(t)&&bo.call(t)==="[object Object]"&&t.constructor===Object}function Io(...t){const e={};t.forEach((t=>{if(!t){return}To(t,((t,i)=>{if(!Eo(t)){e[i]=t;return}if(!Eo(e[i])){e[i]={}}e[i]=Io(e[i],t)}))}));return e}function xo(t={}){const e=[];for(const i in t){if(t.hasOwnProperty(i)){const s=t[i];e.push(s)}}return e}function Ao(t,e,i,s=true){const n=i=>Object.defineProperty(t,e,{value:i,enumerable:true,writable:true});const r={configurable:true,enumerable:true,get(){const t=i();n(t);return t}};if(s){r.set=n}return Object.defineProperty(t,e,r)}var Do=Object.freeze({__proto__:null,each:To,reduce:So,isObject:ko,isPlain:Eo,merge:Io,values:xo,defineLazyProperty:Ao});let Co=false;let jo=null;let _o=false;let No;let Mo=false;let Oo=false;let Lo=false;let Ro=false;let $o=null;let Po=null;let Uo=null;let Fo=false;let Bo=false;let qo=false;let Vo=false;const Ho=Boolean(Qo()&&("ontouchstart"in o||o.navigator.maxTouchPoints||o.DocumentTouch&&o.document instanceof o.DocumentTouch));const zo=o.navigator&&o.navigator.userAgentData;if(zo){_o=zo.platform==="Android";Oo=Boolean(zo.brands.find((t=>t.brand==="Microsoft Edge")));Lo=Boolean(zo.brands.find((t=>t.brand==="Chromium")));Ro=!Oo&&Lo;$o=Po=(zo.brands.find((t=>t.brand==="Chromium"))||{}).version||null;Bo=zo.platform==="Windows"}if(!Lo){const hg=o.navigator&&o.navigator.userAgent||"";Co=/iPod/i.test(hg);jo=function(){const t=hg.match(/OS (\d+)_/i);if(t&&t[1]){return t[1]}return null}();_o=/Android/i.test(hg);No=function(){const t=hg.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t){return null}const e=t[1]&&parseFloat(t[1]);const i=t[2]&&parseFloat(t[2]);if(e&&i){return parseFloat(t[1]+"."+t[2])}else if(e){return e}return null}();Mo=/Firefox/i.test(hg);Oo=/Edg/i.test(hg);Lo=/Chrome/i.test(hg)||/CriOS/i.test(hg);Ro=!Oo&&Lo;$o=Po=function(){const t=hg.match(/(Chrome|CriOS)\/(\d+)/);if(t&&t[2]){return parseFloat(t[2])}return null}();Uo=function(){const t=/MSIE\s(\d+)\.\d/.exec(hg);let e=t&&parseFloat(t[1]);if(!e&&/Trident\/7.0/i.test(hg)&&/rv:11.0/.test(hg)){e=11}return e}();Fo=/Safari/i.test(hg)&&!Ro&&!_o&&!Oo;Bo=/Windows/i.test(hg);qo=/iPad/i.test(hg)||Fo&&Ho&&!/iPhone/i.test(hg);Vo=/iPhone/i.test(hg)&&!qo}const Xo=Vo||qo||Co;const Go=(Fo||Xo)&&!Ro;var Wo=Object.freeze({__proto__:null,get IS_IPOD(){return Co},get IOS_VERSION(){return jo},get IS_ANDROID(){return _o},get ANDROID_VERSION(){return No},get IS_FIREFOX(){return Mo},get IS_EDGE(){return Oo},get IS_CHROMIUM(){return Lo},get IS_CHROME(){return Ro},get CHROMIUM_VERSION(){return $o},get CHROME_VERSION(){return Po},get IE_VERSION(){return Uo},get IS_SAFARI(){return Fo},get IS_WINDOWS(){return Bo},get IS_IPAD(){return qo},get IS_IPHONE(){return Vo},TOUCH_ENABLED:Ho,IS_IOS:Xo,IS_ANY_SAFARI:Go});function Yo(t){return typeof t==="string"&&Boolean(t.trim())}function Ko(t){if(t.indexOf(" ")>=0){throw new Error("class has illegal whitespace characters")}}function Qo(){return l===o.document}function Jo(t){return ko(t)&&t.nodeType===1}function Zo(){try{return o.parent!==o.self}catch(t){return true}}function ta(t){return function(e,i){if(!Yo(e)){return l[t](null)}if(Yo(i)){i=l.querySelector(i)}const s=Jo(i)?i:l;return s[t]&&s[t](e)}}function ea(t="div",e={},i={},s){const n=l.createElement(t);Object.getOwnPropertyNames(e).forEach((function(t){const i=e[t];if(t==="textContent"){ia(n,i)}else if(n[t]!==i||t==="tabIndex"){n[t]=i}}));Object.getOwnPropertyNames(i).forEach((function(t){n.setAttribute(t,i[t])}));if(s){Ta(n,s)}return n}function ia(t,e){if(typeof t.textContent==="undefined"){t.innerText=e}else{t.textContent=e}return t}function sa(t,e){if(e.firstChild){e.insertBefore(t,e.firstChild)}else{e.appendChild(t)}}function na(t,e){Ko(e);return t.classList.contains(e)}function ra(t,...e){t.classList.add(...e.reduce(((t,e)=>t.concat(e.split(/\s+/))),[]));return t}function oa(t,...e){if(!t){go.warn("removeClass was called with an element that doesn't exist");return null}t.classList.remove(...e.reduce(((t,e)=>t.concat(e.split(/\s+/))),[]));return t}function aa(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 ha(t,e){Object.getOwnPropertyNames(e).forEach((function(i){const s=e[i];if(s===null||typeof s==="undefined"||s===false){t.removeAttribute(i)}else{t.setAttribute(i,s===true?"":s)}}))}function ua(t){const e={};const i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(t&&t.attributes&&t.attributes.length>0){const s=t.attributes;for(let t=s.length-1;t>=0;t--){const n=s[t].name;let r=s[t].value;if(i.includes(n)){r=r!==null?true:false}e[n]=r}}return e}function ca(t,e){return t.getAttribute(e)}function fa(t,e,i){t.setAttribute(e,i)}function la(t,e){t.removeAttribute(e)}function da(){l.body.focus();l.onselectstart=function(){return false}}function pa(){l.onselectstart=function(){return true}}function ma(t){if(t&&t.getBoundingClientRect&&t.parentNode){const e=t.getBoundingClientRect();const i={};["bottom","height","left","right","top","width"].forEach((t=>{if(e[t]!==undefined){i[t]=e[t]}}));if(!i.height){i.height=parseFloat(xa(t,"height"))}if(!i.width){i.width=parseFloat(xa(t,"width"))}return i}}function va(t){if(!t||t&&!t.offsetParent){return{left:0,top:0,width:0,height:0}}const e=t.offsetWidth;const i=t.offsetHeight;let s=0;let n=0;while(t.offsetParent&&t!==l[uo.fullscreenElement]){s+=t.offsetLeft;n+=t.offsetTop;t=t.offsetParent}return{left:s,top:n,width:e,height:i}}function ga(t,e){const i={x:0,y:0};if(Xo){let e=t;while(e&&e.nodeName.toLowerCase()!=="html"){const t=xa(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]}e=e.parentNode}}const s={};const n=va(e.target);const r=va(t);const o=r.width;const a=r.height;let h=e.offsetY-(r.top-n.top);let u=e.offsetX-(r.left-n.left);if(e.changedTouches){u=e.changedTouches[0].pageX-r.left;h=e.changedTouches[0].pageY+r.top;if(Xo){u-=i.x;h-=i.y}}s.y=1-Math.max(0,Math.min(1,h/a));s.x=Math.max(0,Math.min(1,u/o));return s}function ya(t){return ko(t)&&t.nodeType===3}function ba(t){while(t.firstChild){t.removeChild(t.firstChild)}return t}function wa(t){if(typeof t==="function"){t=t()}return(Array.isArray(t)?t:[t]).map((t=>{if(typeof t==="function"){t=t()}if(Jo(t)||ya(t)){return t}if(typeof t==="string"&&/\S/.test(t)){return l.createTextNode(t)}})).filter((t=>t))}function Ta(t,e){wa(e).forEach((e=>t.appendChild(e)));return t}function Sa(t,e){return Ta(ba(t),e)}function ka(t){if(t.button===undefined&&t.buttons===undefined){return true}if(t.button===0&&t.buttons===undefined){return true}if(t.type==="mouseup"&&t.button===0&&t.buttons===0){return true}if(t.button!==0||t.buttons!==1){return false}return true}const Ea=ta("querySelector");const Ia=ta("querySelectorAll");function xa(t,e){if(!t||!e){return""}if(typeof o.getComputedStyle==="function"){let i;try{i=o.getComputedStyle(t)}catch(t){return""}return i?i.getPropertyValue(e)||i[e]:""}return""}function Aa(t){[...l.styleSheets].forEach((e=>{try{const i=[...e.cssRules].map((t=>t.cssText)).join("");const s=l.createElement("style");s.textContent=i;t.document.head.appendChild(s)}catch(i){const s=l.createElement("link");s.rel="stylesheet";s.type=e.type;s.media=e.media.mediaText;s.href=e.href;t.document.head.appendChild(s)}}))}var Da=Object.freeze({__proto__:null,isReal:Qo,isEl:Jo,isInFrame:Zo,createEl:ea,textContent:ia,prependTo:sa,hasClass:na,addClass:ra,removeClass:oa,toggleClass:aa,setAttributes:ha,getAttributes:ua,getAttribute:ca,setAttribute:fa,removeAttribute:la,blockTextSelection:da,unblockTextSelection:pa,getBoundingClientRect:ma,findPosition:va,getPointerPosition:ga,isTextNode:ya,emptyEl:ba,normalizeContent:wa,appendContent:Ta,insertContent:Sa,isSingleLeftClick:ka,$:Ea,$$:Ia,computedStyle:xa,copyStyleSheetsToWindow:Aa});let Ca=false;let ja;const _a=function(){if(ja.options.autoSetup===false){return}const t=Array.prototype.slice.call(l.getElementsByTagName("video"));const e=Array.prototype.slice.call(l.getElementsByTagName("audio"));const i=Array.prototype.slice.call(l.getElementsByTagName("video-js"));const s=t.concat(e,i);if(s&&s.length>0){for(let t=0,e=s.length;t<e;t++){const e=s[t];if(e&&e.getAttribute){if(e.player===undefined){const t=e.getAttribute("data-setup");if(t!==null){ja(e)}}}else{Na(1);break}}}else if(!Ca){Na(1)}};function Na(t,e){if(!Qo()){return}if(e){ja=e}o.setTimeout(_a,t)}function Ma(){Ca=true;o.removeEventListener("load",Ma)}if(Qo()){if(l.readyState==="complete"){Ma()}else{o.addEventListener("load",Ma)}}const Oa=function(t){const e=l.createElement("style");e.className=t;return e};const La=function(t,e){if(t.styleSheet){t.styleSheet.cssText=e}else{t.textContent=e}};var Ra=new WeakMap;const $a=3;let Pa=$a;function Ua(){return Pa++}function Fa(t,e){if(!Ra.has(t)){return}const i=Ra.get(t);if(i.handlers[e].length===0){delete i.handlers[e];if(t.removeEventListener){t.removeEventListener(e,i.dispatcher,false)}else if(t.detachEvent){t.detachEvent("on"+e,i.dispatcher)}}if(Object.getOwnPropertyNames(i.handlers).length<=0){delete i.handlers;delete i.dispatcher;delete i.disabled}if(Object.getOwnPropertyNames(i).length===0){Ra.delete(t)}}function Ba(t,e,i,s){i.forEach((function(i){t(e,i,s)}))}function qa(t){if(t.fixed_){return t}function e(){return true}function i(){return false}if(!t||!t.isPropagationStopped||!t.isImmediatePropagationStopped){const s=t||o.event;t={};for(const e in s){if(e!=="layerX"&&e!=="layerY"&&e!=="keyLocation"&&e!=="webkitMovementX"&&e!=="webkitMovementY"&&e!=="path"){if(!(e==="returnValue"&&s.preventDefault)){t[e]=s[e]}}}if(!t.target){t.target=t.srcElement||l}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 e=l.documentElement;const i=l.body;t.pageX=t.clientX+(e&&e.scrollLeft||i&&i.scrollLeft||0)-(e&&e.clientLeft||i&&i.clientLeft||0);t.pageY=t.clientY+(e&&e.scrollTop||i&&i.scrollTop||0)-(e&&e.clientTop||i&&i.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 Va;const Ha=function(){if(typeof Va!=="boolean"){Va=false;try{const t=Object.defineProperty({},"passive",{get(){Va=true}});o.addEventListener("test",null,t);o.removeEventListener("test",null,t)}catch(t){}}return Va};const za=["touchstart","touchmove"];function Xa(t,e,i){if(Array.isArray(e)){return Ba(Xa,t,e,i)}if(!Ra.has(t)){Ra.set(t,{})}const s=Ra.get(t);if(!s.handlers){s.handlers={}}if(!s.handlers[e]){s.handlers[e]=[]}if(!i.guid){i.guid=Ua()}s.handlers[e].push(i);if(!s.dispatcher){s.disabled=false;s.dispatcher=function(e,i){if(s.disabled){return}e=qa(e);const n=s.handlers[e.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r;n++){if(e.isImmediatePropagationStopped()){break}else{try{s[n].call(t,e,i)}catch(t){go.error(t)}}}}}}if(s.handlers[e].length===1){if(t.addEventListener){let i=false;if(Ha()&&za.indexOf(e)>-1){i={passive:true}}t.addEventListener(e,s.dispatcher,i)}else if(t.attachEvent){t.attachEvent("on"+e,s.dispatcher)}}}function Ga(t,e,i){if(!Ra.has(t)){return}const s=Ra.get(t);if(!s.handlers){return}if(Array.isArray(e)){return Ba(Ga,t,e,i)}const n=function(t,e){s.handlers[e]=[];Fa(t,e)};if(e===undefined){for(const e in s.handlers){if(Object.prototype.hasOwnProperty.call(s.handlers||{},e)){n(t,e)}}return}const r=s.handlers[e];if(!r){return}if(!i){n(t,e);return}if(i.guid){for(let t=0;t<r.length;t++){if(r[t].guid===i.guid){r.splice(t--,1)}}}Fa(t,e)}function Wa(t,e,i){const s=Ra.has(t)?Ra.get(t):{};const n=t.parentNode||t.ownerDocument;if(typeof e==="string"){e={type:e,target:t}}else if(!e.target){e.target=t}e=qa(e);if(s.dispatcher){s.dispatcher.call(t,e,i)}if(n&&!e.isPropagationStopped()&&e.bubbles===true){Wa.call(null,n,e,i)}else if(!n&&!e.defaultPrevented&&e.target&&e.target[e.type]){if(!Ra.has(e.target)){Ra.set(e.target,{})}const t=Ra.get(e.target);if(e.target[e.type]){t.disabled=true;if(typeof e.target[e.type]==="function"){e.target[e.type]()}t.disabled=false}}return!e.defaultPrevented}function Ya(t,e,i){if(Array.isArray(e)){return Ba(Ya,t,e,i)}const s=function(){Ga(t,e,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||Ua();Xa(t,e,s)}function Ka(t,e,i){const s=function(){Ga(t,e,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||Ua();Xa(t,e,s)}var Qa=Object.freeze({__proto__:null,fixEvent:qa,on:Xa,off:Ga,trigger:Wa,one:Ya,any:Ka});const Ja=30;const Za=function(t,e,i){if(!e.guid){e.guid=Ua()}const s=e.bind(t);s.guid=i?i+"_"+e.guid:e.guid;return s};const th=function(t,e){let i=o.performance.now();const s=function(...s){const n=o.performance.now();if(n-i>=e){t(...s);i=n}};return s};const eh=function(t,e,i,s=o){let n;const r=()=>{s.clearTimeout(n);n=null};const a=function(){const r=this;const o=arguments;let a=function(){n=null;a=null;if(!i){t.apply(r,o)}};if(!n&&i){t.apply(r,o)}s.clearTimeout(n);n=s.setTimeout(a,e)};a.cancel=r;return a};var ih=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ja,bind_:Za,throttle:th,debounce:eh});let sh;class nh{on(t,e){const i=this.addEventListener;this.addEventListener=()=>{};Xa(this,t,e);this.addEventListener=i}off(t,e){Ga(this,t,e)}one(t,e){const i=this.addEventListener;this.addEventListener=()=>{};Ya(this,t,e);this.addEventListener=i}any(t,e){const i=this.addEventListener;this.addEventListener=()=>{};Ka(this,t,e);this.addEventListener=i}trigger(t){const e=t.type||t;if(typeof t==="string"){t={type:e}}t=qa(t);if(this.allowedEvents_[e]&&this["on"+e]){this["on"+e](t)}Wa(this,t)}queueTrigger(t){if(!sh){sh=new Map}const e=t.type||t;let i=sh.get(this);if(!i){i=new Map;sh.set(this,i)}const s=i.get(e);i.delete(e);o.clearTimeout(s);const n=o.setTimeout((()=>{i.delete(e);if(i.size===0){i=null;sh.delete(this)}this.trigger(t)}),0);i.set(e,n)}}nh.prototype.allowedEvents_={};nh.prototype.addEventListener=nh.prototype.on;nh.prototype.removeEventListener=nh.prototype.off;nh.prototype.dispatchEvent=nh.prototype.trigger;const rh=t=>{if(typeof t.name==="function"){return t.name()}if(typeof t.name==="string"){return t.name}if(t.name_){return t.name_}if(t.constructor&&t.constructor.name){return t.constructor.name}return typeof t};const oh=t=>t instanceof nh||!!t.eventBusEl_&&["on","one","off","trigger"].every((e=>typeof t[e]==="function"));const ah=(t,e)=>{if(oh(t)){e()}else{if(!t.eventedCallbacks){t.eventedCallbacks=[]}t.eventedCallbacks.push(e)}};const hh=t=>typeof t==="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length;const uh=(t,e,i)=>{if(!t||!t.nodeName&&!oh(t)){throw new Error(`Invalid target for ${rh(e)}#${i}; must be a DOM node or evented object.`)}};const ch=(t,e,i)=>{if(!hh(t)){throw new Error(`Invalid event type for ${rh(e)}#${i}; must be a non-empty string or array.`)}};const fh=(t,e,i)=>{if(typeof t!=="function"){throw new Error(`Invalid listener for ${rh(e)}#${i}; must be a function.`)}};const lh=(t,e,i)=>{const s=e.length<3||e[0]===t||e[0]===t.eventBusEl_;let n;let r;let o;if(s){n=t.eventBusEl_;if(e.length>=3){e.shift()}[r,o]=e}else{[n,r,o]=e}uh(n,t,i);ch(r,t,i);fh(o,t,i);o=Za(t,o);return{isTargetingSelf:s,target:n,type:r,listener:o}};const dh=(t,e,i,s)=>{uh(t,t,e);if(t.nodeName){Qa[e](t,i,s)}else{t[e](i,s)}};const ph={on(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=lh(this,t,"on");dh(i,"on",s,n);if(!e){const t=()=>this.off(i,s,n);t.guid=n.guid;const e=()=>this.off("dispose",t);e.guid=n.guid;dh(this,"on","dispose",t);dh(i,"on","dispose",e)}},one(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=lh(this,t,"one");if(e){dh(i,"one",s,n)}else{const t=(...e)=>{this.off(i,s,t);n.apply(null,e)};t.guid=n.guid;dh(i,"one",s,t)}},any(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=lh(this,t,"any");if(e){dh(i,"any",s,n)}else{const t=(...e)=>{this.off(i,s,t);n.apply(null,e)};t.guid=n.guid;dh(i,"any",s,t)}},off(t,e,i){if(!t||hh(t)){Ga(this.eventBusEl_,t,e)}else{const s=t;const n=e;uh(s,this,"off");ch(n,this,"off");fh(i,this,"off");i=Za(this,i);this.off("dispose",i);if(s.nodeName){Ga(s,n,i);Ga(s,"dispose",i)}else if(oh(s)){s.off(n,i);s.off("dispose",i)}}},trigger(t,e){uh(this.eventBusEl_,this,"trigger");const i=t&&typeof t!=="string"?t.type:t;if(!hh(i)){throw new Error(`Invalid event type for ${rh(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}return Wa(this.eventBusEl_,t,e)}};function mh(t,e={}){const{eventBusKey:i}=e;if(i){if(!t[i].nodeName){throw new Error(`The eventBusKey "${i}" does not refer to an element.`)}t.eventBusEl_=t[i]}else{t.eventBusEl_=ea("span",{className:"vjs-event-bus"})}Object.assign(t,ph);if(t.eventedCallbacks){t.eventedCallbacks.forEach((t=>{t()}))}t.on("dispose",(()=>{t.off();[t,t.el_,t.eventBusEl_].forEach((function(t){if(t&&Ra.has(t)){Ra.delete(t)}}));o.setTimeout((()=>{t.eventBusEl_=null}),0)}));return t}const vh={state:{},setState(t){if(typeof t==="function"){t=t()}let e;To(t,((t,i)=>{if(this.state[i]!==t){e=e||{};e[i]={from:this.state[i],to:t}}this.state[i]=t}));if(e&&oh(this)){this.trigger({changes:e,type:"statechanged"})}return e}};function gh(t,e){Object.assign(t,vh);t.state=Object.assign({},t.state,e);if(typeof t.handleStateChanged==="function"&&oh(t)){t.on("statechanged",t.handleStateChanged)}return t}const yh=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toLowerCase()))};const bh=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toUpperCase()))};const wh=function(t,e){return bh(t)===bh(e)};var Th=Object.freeze({__proto__:null,toLowerCase:yh,toTitleCase:bh,titleCaseEquals:wh});class Sh{constructor(t,e,i){if(!t&&this.play){this.player_=t=this}else{this.player_=t}this.isDisposed_=false;this.parentComponent_=null;this.options_=Io({},this.options_);e=this.options_=Io(this.options_,e);this.id_=e.id||e.el&&e.el.id;if(!this.id_){const e=t&&t.id&&t.id()||"no_player";this.id_=`${e}_component_${Ua()}`}this.name_=e.name||null;if(e.el){this.el_=e.el}else if(e.createEl!==false){this.el_=this.createEl()}if(e.className&&this.el_){e.className.split(" ").forEach((t=>this.addClass(t)))}["on","off","one","any","trigger"].forEach((t=>{this[t]=undefined}));if(e.evented!==false){mh(this,{eventBusKey:this.el_?"el_":null});this.handleLanguagechange=this.handleLanguagechange.bind(this);this.on(this.player_,"languagechange",this.handleLanguagechange)}gh(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(e.initChildren!==false){this.initChildren()}this.ready(i);if(e.reportTouchActivity!==false){this.enableTouchActivity()}}on(t,e){}off(t,e){}one(t,e){}any(t,e){}trigger(t,e){}dispose(t={}){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 t=this.children_.length-1;t>=0;t--){if(this.children_[t].dispose){this.children_[t].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){if(t.restoreEl){this.el_.parentNode.replaceChild(t.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(t){if(!t){return this.options_}this.options_=Io(this.options_,t);return this.options_}el(){return this.el_}createEl(t,e,i){return ea(t,e,i)}localize(t,e,i=t){const s=this.player_.language&&this.player_.language();const n=this.player_.languages&&this.player_.languages();const r=n&&n[s];const o=s&&s.split("-")[0];const a=n&&n[o];let h=i;if(r&&r[t]){h=r[t]}else if(a&&a[t]){h=a[t]}if(e){h=h.replace(/\{(\d+)\}/g,(function(t,i){const s=e[i-1];let n=s;if(typeof s==="undefined"){n=t}return n}))}return h}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(t){return this.childIndex_[t]}getChild(t){if(!t){return}return this.childNameIndex_[t]}getDescendant(...t){t=t.reduce(((t,e)=>t.concat(e)),[]);let e=this;for(let i=0;i<t.length;i++){e=e.getChild(t[i]);if(!e||!e.getChild){return}}return e}setIcon(t,e=this.el()){if(!this.player_.options_.experimentalSvgIcons){return}const i="http://www.w3.org/2000/svg";const s=ea("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"});const n=l.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const r=l.createElementNS(i,"use");n.appendChild(r);r.setAttributeNS(null,"href",`#vjs-icon-${t}`);s.appendChild(n);if(this.iconIsSet_){e.replaceChild(s,e.querySelector(".vjs-icon-placeholder"))}else{e.appendChild(s)}this.iconIsSet_=true;return s}addChild(t,e={},i=this.children_.length){let s;let n;if(typeof t==="string"){n=bh(t);const i=e.componentClass||n;e.name=n;const r=Sh.getComponent(i);if(!r){throw new Error(`Component ${i} does not exist`)}if(typeof r!=="function"){return null}s=new r(this.player_||this,e)}else{s=t}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&&bh(s.name());if(n){this.childNameIndex_[n]=s;this.childNameIndex_[yh(n)]=s}if(typeof s.el==="function"&&s.el()){let t=null;if(this.children_[i+1]){if(this.children_[i+1].el_){t=this.children_[i+1].el_}else if(Jo(this.children_[i+1])){t=this.children_[i+1]}}this.contentEl().insertBefore(s.el(),t)}return s}removeChild(t){if(typeof t==="string"){t=this.getChild(t)}if(!t||!this.children_){return}let e=false;for(let i=this.children_.length-1;i>=0;i--){if(this.children_[i]===t){e=true;this.children_.splice(i,1);break}}if(!e){return}t.parentComponent_=null;this.childIndex_[t.id()]=null;this.childNameIndex_[bh(t.name())]=null;this.childNameIndex_[yh(t.name())]=null;const i=t.el();if(i&&i.parentNode===this.contentEl()){this.contentEl().removeChild(t.el())}}initChildren(){const t=this.options_.children;if(t){const e=this.options_;const i=t=>{const i=t.name;let s=t.opts;if(e[i]!==undefined){s=e[i]}if(s===false){return}if(s===true){s={}}s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);if(n){this[i]=n}};let s;const n=Sh.getComponent("Tech");if(Array.isArray(t)){s=t}else{s=Object.keys(t)}s.concat(Object.keys(this.options_).filter((function(t){return!s.some((function(e){if(typeof e==="string"){return t===e}return t===e.name}))}))).map((e=>{let i;let s;if(typeof e==="string"){i=e;s=t[i]||this.options_[i]||{}}else{i=e.name;s=e}return{name:i,opts:s}})).filter((t=>{const e=Sh.getComponent(t.opts.componentClass||bh(t.name));return e&&!n.isTech(e)})).forEach(i)}}buildCSSClass(){return""}ready(t,e=false){if(!t){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(t);return}if(e){t.call(this)}else{this.setTimeout(t,1)}}triggerReady(){this.isReady_=true;this.setTimeout((function(){const t=this.readyQueue_;this.readyQueue_=[];if(t&&t.length>0){t.forEach((function(t){t.call(this)}),this)}this.trigger("ready")}),1)}$(t,e){return Ea(t,e||this.contentEl())}$$(t,e){return Ia(t,e||this.contentEl())}hasClass(t){return na(this.el_,t)}addClass(...t){ra(this.el_,...t)}removeClass(...t){oa(this.el_,...t)}toggleClass(t,e){aa(this.el_,t,e)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(t){return ca(this.el_,t)}setAttribute(t,e){fa(this.el_,t,e)}removeAttribute(t){la(this.el_,t)}width(t,e){return this.dimension("width",t,e)}height(t,e){return this.dimension("height",t,e)}dimensions(t,e){this.width(t,true);this.height(e)}dimension(t,e,i){if(e!==undefined){if(e===null||e!==e){e=0}if((""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1){this.el_.style[t]=e}else if(e==="auto"){this.el_.style[t]=""}else{this.el_.style[t]=e+"px"}if(!i){this.trigger("componentresize")}return}if(!this.el_){return 0}const s=this.el_.style[t];const n=s.indexOf("px");if(n!==-1){return parseInt(s.slice(0,n),10)}return parseInt(this.el_["offset"+bh(t)],10)}currentDimension(t){let e=0;if(t!=="width"&&t!=="height"){throw new Error("currentDimension only accepts width or height value")}e=xa(this.el_,t);e=parseFloat(e);if(e===0||isNaN(e)){const i=`offset${bh(t)}`;e=this.el_[i]}return e}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(t){if(this.player_){if(!d.isEventKey(t,"Tab")){t.stopPropagation()}this.player_.handleKeyDown(t)}}handleKeyPress(t){this.handleKeyDown(t)}emitTapEvents(){let t=0;let e=null;const i=10;const s=200;let n;this.on("touchstart",(function(i){if(i.touches.length===1){e={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY};t=o.performance.now();n=true}}));this.on("touchmove",(function(t){if(t.touches.length>1){n=false}else if(e){const s=t.touches[0].pageX-e.pageX;const r=t.touches[0].pageY-e.pageY;const o=Math.sqrt(s*s+r*r);if(o>i){n=false}}}));const r=function(){n=false};this.on("touchleave",r);this.on("touchcancel",r);this.on("touchend",(function(i){e=null;if(n===true){const e=o.performance.now()-t;if(e<s){i.preventDefault();this.trigger("tap")}}}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity){return}const t=Za(this.player(),this.player().reportUserActivity);let e;this.on("touchstart",(function(){t();this.clearInterval(e);e=this.setInterval(t,250)}));const i=function(i){t();this.clearInterval(e)};this.on("touchmove",t);this.on("touchend",i);this.on("touchcancel",i)}setTimeout(t,e){var i;t=Za(this,t);this.clearTimersOnDispose_();i=o.setTimeout((()=>{if(this.setTimeoutIds_.has(i)){this.setTimeoutIds_.delete(i)}t()}),e);this.setTimeoutIds_.add(i);return i}clearTimeout(t){if(this.setTimeoutIds_.has(t)){this.setTimeoutIds_.delete(t);o.clearTimeout(t)}return t}setInterval(t,e){t=Za(this,t);this.clearTimersOnDispose_();const i=o.setInterval(t,e);this.setIntervalIds_.add(i);return i}clearInterval(t){if(this.setIntervalIds_.has(t)){this.setIntervalIds_.delete(t);o.clearInterval(t)}return t}requestAnimationFrame(t){this.clearTimersOnDispose_();var e;t=Za(this,t);e=o.requestAnimationFrame((()=>{if(this.rafIds_.has(e)){this.rafIds_.delete(e)}t()}));this.rafIds_.add(e);return e}requestNamedAnimationFrame(t,e){if(this.namedRafs_.has(t)){return}this.clearTimersOnDispose_();e=Za(this,e);const i=this.requestAnimationFrame((()=>{e();if(this.namedRafs_.has(t)){this.namedRafs_.delete(t)}}));this.namedRafs_.set(t,i);return t}cancelNamedAnimationFrame(t){if(!this.namedRafs_.has(t)){return}this.cancelAnimationFrame(this.namedRafs_.get(t));this.namedRafs_.delete(t)}cancelAnimationFrame(t){if(this.rafIds_.has(t)){this.rafIds_.delete(t);o.cancelAnimationFrame(t)}return t}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=true;this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([t,e])=>{this[t].forEach(((t,i)=>this[e](i)))}));this.clearingTimersOnDispose_=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=Sh.getComponent("Tech");const s=i&&i.isTech(e);const n=Sh===e||Sh.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=bh(t);if(!Sh.components_){Sh.components_={}}const r=Sh.getComponent("Player");if(t==="Player"&&r&&r.players){const t=r.players;const e=Object.keys(t);if(t&&e.length>0&&e.map((e=>t[e])).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}Sh.components_[t]=e;Sh.components_[yh(t)]=e;return e}static getComponent(t){if(!t||!Sh.components_){return}return Sh.components_[t]}}Sh.registerComponent("Component",Sh);function kh(t,e,i){if(typeof e!=="number"||e<0||e>i){throw new Error(`Failed to execute '${t}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${i}).`)}}function Eh(t,e,i,s){kh(t,s,i.length-1);return i[s][e]}function Ih(t){let e;if(t===undefined||t.length===0){e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}}else{e={length:t.length,start:Eh.bind(null,"start",0,t),end:Eh.bind(null,"end",1,t)}}if(o.Symbol&&o.Symbol.iterator){e[o.Symbol.iterator]=()=>(t||[]).values()}return e}function xh(t,e){if(Array.isArray(t)){return Ih(t)}else if(t===undefined||e===undefined){return Ih()}return Ih([[t,e]])}const Ah=function(t,e){t=t<0?0:t;let i=Math.floor(t%60);let s=Math.floor(t/60%60);let n=Math.floor(t/3600);const r=Math.floor(e/60%60);const o=Math.floor(e/3600);if(isNaN(t)||t===Infinity){n=s=i="-"}n=n>0||o>0?n+":":"";s=((n||r>=10)&&s<10?"0"+s:s)+":";i=i<10?"0"+i:i;return n+s+i};let Dh=Ah;function Ch(t){Dh=t}function jh(){Dh=Ah}function _h(t,e=t){return Dh(t,e)}var Nh=Object.freeze({__proto__:null,createTimeRanges:xh,createTimeRange:xh,setFormatTime:Ch,resetFormatTime:jh,formatTime:_h});function Mh(t,e){let i=0;let s;let n;if(!e){return 0}if(!t||!t.length){t=xh(0,0)}for(let r=0;r<t.length;r++){s=t.start(r);n=t.end(r);if(n>e){n=e}i+=n-s}return i/e}function Oh(t){if(t instanceof Oh){return t}if(typeof t==="number"){this.code=t}else if(typeof t==="string"){this.message=t}else if(ko(t)){if(typeof t.code==="number"){this.code=t.code}Object.assign(this,t)}if(!this.message){this.message=Oh.defaultMessages[this.code]||""}}Oh.prototype.code=0;Oh.prototype.message="";Oh.prototype.status=null;Oh.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Oh.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."};for(let ug=0;ug<Oh.errorTypes.length;ug++){Oh[Oh.errorTypes[ug]]=ug;Oh.prototype[Oh.errorTypes[ug]]=ug}function Lh(t){return t!==undefined&&t!==null&&typeof t.then==="function"}function Rh(t){if(Lh(t)){t.then(null,(t=>{}))}}const $h=function(t){const e=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((e,i,s)=>{if(t[i]){e[i]=t[i]}return e}),{cues:t.cues&&Array.prototype.map.call(t.cues,(function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}}))});return e};const Ph=function(t){const e=t.$$("track");const i=Array.prototype.map.call(e,(t=>t.track));const s=Array.prototype.map.call(e,(function(t){const e=$h(t.track);if(t.src){e.src=t.src}return e}));return s.concat(Array.prototype.filter.call(t.textTracks(),(function(t){return i.indexOf(t)===-1})).map($h))};const Uh=function(t,e){t.forEach((function(t){const i=e.addRemoteTextTrack(t).track;if(!t.src&&t.cues){t.cues.forEach((t=>i.addCue(t)))}}));return e.textTracks()};var Fh={textTracksToJson:Ph,jsonToTextTracks:Uh,trackToJson_:$h};const Bh="vjs-modal-dialog";class qh extends Sh{constructor(t,e){super(t,e);this.handleKeyDown_=t=>this.handleKeyDown(t);this.close_=t=>this.close(t);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=false;this.closeable(!this.options_.uncloseable);this.content(this.options_.content);this.contentEl_=ea("div",{className:`${Bh}-content`},{role:"document"});this.descEl_=ea("p",{className:`${Bh}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")});ia(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"})}dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;super.dispose()}buildCSSClass(){return`${Bh} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let t=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return t}open(){if(!this.opened_){const t=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!t.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){t.pause()}this.on("keydown",this.handleKeyDown_);this.hadControls_=t.controls();t.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}}opened(t){if(typeof t==="boolean"){this[t?"open":"close"]()}return this.opened_}close(){if(!this.opened_){return}const t=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){t.play()}this.off("keydown",this.handleKeyDown_);if(this.hadControls_){t.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}}closeable(t){if(typeof t==="boolean"){const e=this.closeable_=!!t;let i=this.getChild("closeButton");if(e&&!i){const t=this.contentEl_;this.contentEl_=this.el_;i=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=t;this.on(i,"close",this.close_)}if(!e&&i){this.off(i,"close",this.close_);this.removeChild(i);i.dispose()}}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(t){const e=this.contentEl();const i=e.parentNode;const s=e.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;i.removeChild(e);this.empty();Sa(e,t);this.trigger("modalfill");if(s){i.insertBefore(e,s)}else{i.appendChild(e)}const n=this.getChild("closeButton");if(n){i.appendChild(n.el_)}}empty(){this.trigger("beforemodalempty");ba(this.contentEl());this.trigger("modalempty")}content(t){if(typeof t!=="undefined"){this.content_=t}return this.content_}conditionalFocus_(){const t=l.activeElement;const e=this.player_.el_;this.previouslyActiveEl_=null;if(e.contains(t)||e===t){this.previouslyActiveEl_=t;this.focus()}}conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}}handleKeyDown(t){t.stopPropagation();if(d.isEventKey(t,"Escape")&&this.closeable()){t.preventDefault();this.close();return}if(!d.isEventKey(t,"Tab")){return}const e=this.focusableEls_();const i=this.el_.querySelector(":focus");let s;for(let t=0;t<e.length;t++){if(i===e[t]){s=t;break}}if(l.activeElement===this.el_){s=0}if(t.shiftKey&&s===0){e[e.length-1].focus();t.preventDefault()}else if(!t.shiftKey&&s===e.length-1){e[0].focus();t.preventDefault()}}focusableEls_(){const t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,(t=>(t instanceof o.HTMLAnchorElement||t instanceof o.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof o.HTMLInputElement||t instanceof o.HTMLSelectElement||t instanceof o.HTMLTextAreaElement||t instanceof o.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof o.HTMLIFrameElement||t instanceof o.HTMLObjectElement||t instanceof o.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable")))}}qh.prototype.options_={pauseOnOpen:true,temporary:true};Sh.registerComponent("ModalDialog",qh);class Vh extends nh{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(t){const e=this.tracks_.length;if(!(""+e in this)){Object.defineProperty(this,e,{get(){return this.tracks_[e]}})}if(this.tracks_.indexOf(t)===-1){this.tracks_.push(t);this.trigger({track:t,type:"addtrack",target:this})}t.labelchange_=()=>{this.trigger({track:t,type:"labelchange",target:this})};if(oh(t)){t.addEventListener("labelchange",t.labelchange_)}}removeTrack(t){let e;for(let i=0,s=this.length;i<s;i++){if(this[i]===t){e=this[i];if(e.off){e.off()}this.tracks_.splice(i,1);break}}if(!e){return}this.trigger({track:e,type:"removetrack",target:this})}getTrackById(t){let e=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===t){e=s;break}}return e}}Vh.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const cg in Vh.prototype.allowedEvents_){Vh.prototype["on"+cg]=null}const Hh=function(t,e){for(let i=0;i<t.length;i++){if(!Object.keys(t[i]).length||e.id===t[i].id){continue}t[i].enabled=false}};class zh extends Vh{constructor(t=[]){for(let e=t.length-1;e>=0;e--){if(t[e].enabled){Hh(t,t[e]);break}}super(t);this.changing_=false}addTrack(t){if(t.enabled){Hh(this,t)}super.addTrack(t);if(!t.addEventListener){return}t.enabledChange_=()=>{if(this.changing_){return}this.changing_=true;Hh(this,t);this.changing_=false;this.trigger("change")};t.addEventListener("enabledchange",t.enabledChange_)}removeTrack(t){super.removeTrack(t);if(t.removeEventListener&&t.enabledChange_){t.removeEventListener("enabledchange",t.enabledChange_);t.enabledChange_=null}}}const Xh=function(t,e){for(let i=0;i<t.length;i++){if(!Object.keys(t[i]).length||e.id===t[i].id){continue}t[i].selected=false}};class Gh extends Vh{constructor(t=[]){for(let e=t.length-1;e>=0;e--){if(t[e].selected){Xh(t,t[e]);break}}super(t);this.changing_=false;Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++){if(this[t].selected){return t}}return-1},set(){}})}addTrack(t){if(t.selected){Xh(this,t)}super.addTrack(t);if(!t.addEventListener){return}t.selectedChange_=()=>{if(this.changing_){return}this.changing_=true;Xh(this,t);this.changing_=false;this.trigger("change")};t.addEventListener("selectedchange",t.selectedChange_)}removeTrack(t){super.removeTrack(t);if(t.removeEventListener&&t.selectedChange_){t.removeEventListener("selectedchange",t.selectedChange_);t.selectedChange_=null}}}class Wh extends Vh{addTrack(t){super.addTrack(t);if(!this.queueChange_){this.queueChange_=()=>this.queueTrigger("change")}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")}t.addEventListener("modechange",this.queueChange_);const e=["metadata","chapters"];if(e.indexOf(t.kind)===-1){t.addEventListener("modechange",this.triggerSelectedlanguagechange_)}}removeTrack(t){super.removeTrack(t);if(t.removeEventListener){if(this.queueChange_){t.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){t.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}}}class Yh{constructor(t=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let e=0,i=t.length;e<i;e++){this.addTrackElement_(t[e])}}addTrackElement_(t){const e=this.trackElements_.length;if(!(""+e in this)){Object.defineProperty(this,e,{get(){return this.trackElements_[e]}})}if(this.trackElements_.indexOf(t)===-1){this.trackElements_.push(t)}}getTrackElementByTrack_(t){let e;for(let i=0,s=this.trackElements_.length;i<s;i++){if(t===this.trackElements_[i].track){e=this.trackElements_[i];break}}return e}removeTrackElement_(t){for(let e=0,i=this.trackElements_.length;e<i;e++){if(t===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 Kh{constructor(t){Kh.prototype.setCues_.call(this,t);Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(t){const e=this.length||0;let i=0;const s=t.length;this.cues_=t;this.length_=t.length;const n=function(t){if(!(""+t in this)){Object.defineProperty(this,""+t,{get(){return this.cues_[t]}})}};if(e<s){i=e;for(;i<s;i++){n.call(this,i)}}}getCueById(t){let e=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===t){e=s;break}}return e}}const Qh={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"};const Jh={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"};const Zh={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"};const tu={disabled:"disabled",hidden:"hidden",showing:"showing"};class eu extends nh{constructor(t={}){super();const e={id:t.id||"vjs_track_"+Ua(),kind:t.kind||"",language:t.language||""};let i=t.label||"";for(const t in e){Object.defineProperty(this,t,{get(){return e[t]},set(){}})}Object.defineProperty(this,"label",{get(){return i},set(t){if(t!==i){i=t;this.trigger("labelchange")}}})}}const iu=function(t){const e=["protocol","hostname","port","pathname","search","hash","host"];const i=l.createElement("a");i.href=t;const s={};for(let t=0;t<e.length;t++){s[e[t]]=i[e[t]]}if(s.protocol==="http:"){s.host=s.host.replace(/:80$/,"")}if(s.protocol==="https:"){s.host=s.host.replace(/:443$/,"")}if(!s.protocol){s.protocol=o.location.protocol}if(!s.host){s.host=o.location.host}return s};const su=function(t){if(!t.match(/^https?:\/\//)){const e=l.createElement("a");e.href=t;t=e.href}return t};const nu=function(t){if(typeof t==="string"){const e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;const i=e.exec(t);if(i){return i.pop().toLowerCase()}}return""};const ru=function(t,e=o.location){const i=iu(t);const s=i.protocol===":"?e.protocol:i.protocol;const n=s+i.host!==e.protocol+e.host;return n};var ou=Object.freeze({__proto__:null,parseUrl:iu,getAbsoluteURL:su,getFileExtension:nu,isCrossOrigin:ru});const au=function(t,e){const i=new o.WebVTT.Parser(o,o.vttjs,o.WebVTT.StringDecoder());const s=[];i.oncue=function(t){e.addCue(t)};i.onparsingerror=function(t){s.push(t)};i.onflush=function(){e.trigger({type:"loadeddata",target:e})};i.parse(t);if(s.length>0){if(o.console&&o.console.groupCollapsed){o.console.groupCollapsed(`Text Track parsing errors for ${e.src}`)}s.forEach((t=>go.error(t)));if(o.console&&o.console.groupEnd){o.console.groupEnd()}}i.flush()};const hu=function(t,e){const i={uri:t};const s=ru(t);if(s){i.cors=s}const n=e.tech_.crossOrigin()==="use-credentials";if(n){i.withCredentials=n}I(i,Za(this,(function(t,i,s){if(t){return go.error(t,i)}e.loaded_=true;if(typeof o.WebVTT!=="function"){if(e.tech_){e.tech_.any(["vttjsloaded","vttjserror"],(t=>{if(t.type==="vttjserror"){go.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return au(s,e)}))}}else{au(s,e)}})))};class uu extends eu{constructor(t={}){if(!t.tech){throw new Error("A tech was not provided.")}const e=Io(t,{kind:Zh[t.kind]||"subtitles",language:t.language||t.srclang||""});let i=tu[e.mode]||"disabled";const s=e.default;if(e.kind==="metadata"||e.kind==="chapters"){i="hidden"}super(e);this.tech_=e.tech;this.cues_=[];this.activeCues_=[];this.preload_=this.tech_.preloadTextTracks!==false;const n=new Kh(this.cues_);const r=new Kh(this.activeCues_);let o=false;this.timeupdateHandler=Za(this,(function(t={}){if(this.tech_.isDisposed()){return}if(!this.tech_.isReady_){if(t.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}return}this.activeCues=this.activeCues;if(o){this.trigger("cuechange");o=false}if(t.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}}));const a=()=>{this.stopTracking()};this.tech_.one("dispose",a);if(i!=="disabled"){this.startTracking()}Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return i},set(t){if(!tu[t]){return}if(i===t){return}i=t;if(!this.preload_&&i!=="disabled"&&this.cues.length===0){hu(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 t=this.tech_.currentTime();const e=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];if(s.startTime<=t&&s.endTime>=t){e.push(s)}}o=false;if(e.length!==this.activeCues_.length){o=true}else{for(let t=0;t<e.length;t++){if(this.activeCues_.indexOf(e[t])===-1){o=true}}}this.activeCues_=e;r.setCues_(this.activeCues_);return r},set(){}}});if(e.src){this.src=e.src;if(!this.preload_){this.loaded_=true}if(this.preload_||e.kind!=="subtitles"&&e.kind!=="captions"){hu(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(t){let e=t;if(e.constructor&&e.constructor.name!=="VTTCue"){e=new o.vttjs.VTTCue(t.startTime,t.endTime,t.text);for(const i in t){if(!(i in e)){e[i]=t[i]}}e.id=t.id;e.originalCue_=t}const i=this.tech_.textTracks();for(let t=0;t<i.length;t++){if(i[t]!==this){i[t].removeCue(e)}}this.cues_.push(e);this.cues.setCues_(this.cues_)}removeCue(t){let e=this.cues_.length;while(e--){const i=this.cues_[e];if(i===t||i.originalCue_&&i.originalCue_===t){this.cues_.splice(e,1);this.cues.setCues_(this.cues_);break}}}}uu.prototype.allowedEvents_={cuechange:"cuechange"};class cu extends eu{constructor(t={}){const e=Io(t,{kind:Jh[t.kind]||""});super(e);let i=false;Object.defineProperty(this,"enabled",{get(){return i},set(t){if(typeof t!=="boolean"||t===i){return}i=t;this.trigger("enabledchange")}});if(e.enabled){this.enabled=e.enabled}this.loaded_=true}}class fu extends eu{constructor(t={}){const e=Io(t,{kind:Qh[t.kind]||""});super(e);let i=false;Object.defineProperty(this,"selected",{get(){return i},set(t){if(typeof t!=="boolean"||t===i){return}i=t;this.trigger("selectedchange")}});if(e.selected){this.selected=e.selected}}}class lu extends nh{constructor(t={}){super();let e;const i=new uu(t);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 e}},track:{get(){return i}}});e=lu.NONE;i.addEventListener("loadeddata",(()=>{e=lu.LOADED;this.trigger({type:"load",target:this})}))}}lu.prototype.allowedEvents_={load:"load"};lu.NONE=0;lu.LOADING=1;lu.LOADED=2;lu.ERROR=3;const du={audio:{ListClass:zh,TrackClass:cu,capitalName:"Audio"},video:{ListClass:Gh,TrackClass:fu,capitalName:"Video"},text:{ListClass:Wh,TrackClass:uu,capitalName:"Text"}};Object.keys(du).forEach((function(t){du[t].getterName=`${t}Tracks`;du[t].privateName=`${t}Tracks_`}));const pu={remoteText:{ListClass:Wh,TrackClass:uu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Yh,TrackClass:lu,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};const mu=Object.assign({},du,pu);pu.names=Object.keys(pu);du.names=Object.keys(du);mu.names=[].concat(pu.names).concat(du.names);function vu(t,e,i,s,n={}){const r=t.textTracks();n.kind=e;if(i){n.label=i}if(s){n.language=s}n.tech=t;const o=new mu.text.TrackClass(n);r.addTrack(o);return o}class gu extends Sh{constructor(t={},e=function(){}){t.reportTouchActivity=false;super(null,t,e);this.onDurationChange_=t=>this.onDurationChange(t);this.trackProgress_=t=>this.trackProgress(t);this.trackCurrentTime_=t=>this.trackCurrentTime(t);this.stopTrackingCurrentTime_=t=>this.stopTrackingCurrentTime(t);this.disposeSourceHandler_=t=>this.disposeSourceHandler(t);this.queuedHanders_=new Set;this.hasStarted_=false;this.on("playing",(function(){this.hasStarted_=true}));this.on("loadstart",(function(){this.hasStarted_=false}));mu.names.forEach((e=>{const i=mu[e];if(t&&t[i.getterName]){this[i.privateName]=t[i.getterName]}}));if(!this.featuresProgressEvents){this.manualProgressOn()}if(!this.featuresTimeupdateEvents){this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach((e=>{if(t[`native${e}Tracks`]===false){this[`featuresNative${e}Tracks`]=false}}));if(t.nativeCaptions===false||t.nativeTextTracks===false){this.featuresNativeTextTracks=false}else if(t.nativeCaptions===true||t.nativeTextTracks===true){this.featuresNativeTextTracks=true}if(!this.featuresNativeTextTracks){this.emulateTextTracks()}this.preloadTextTracks=t.preloadTextTracks!==false;this.autoRemoteTextTracks_=new mu.text.ListClass;this.initTrackListeners();if(!t.nativeControlsForTouch){this.emitTapEvents()}if(this.constructor){this.name_=this.constructor.name||"Unknown Tech"}}triggerSourceset(t){if(!this.isReady_){this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(t)),1)))}this.trigger({src:t,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(t){this.stopTrackingProgress();this.progressInterval=this.setInterval(Za(this,(function(){const t=this.bufferedPercent();if(this.bufferedPercent_!==t){this.trigger("progress")}this.bufferedPercent_=t;if(t===1){this.stopTrackingProgress()}})),500)}onDurationChange(t){this.duration_=this.duration()}buffered(){return xh(0,0)}bufferedPercent(){return Mh(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(du.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}super.dispose()}clearTracks(t){t=[].concat(t);t.forEach((t=>{const e=this[`${t}Tracks`]()||[];let i=e.length;while(i--){const s=e[i];if(t==="text"){this.removeRemoteTextTrack(s)}e.removeTrack(s)}}))}cleanupAutoTextTracks(){const t=this.autoRemoteTextTracks_||[];let e=t.length;while(e--){const i=t[e];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(t){if(t!==undefined){this.error_=new Oh(t);this.trigger("error")}return this.error_}played(){if(this.hasStarted_){return xh(0,0)}return xh()}play(){}setScrubbing(t){}scrubbing(){}setCurrentTime(t){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}}initTrackListeners(){du.names.forEach((t=>{const e=du[t];const i=()=>{this.trigger(`${t}trackchange`)};const s=this[e.getterName]();s.addEventListener("removetrack",i);s.addEventListener("addtrack",i);this.on("dispose",(()=>{s.removeEventListener("removetrack",i);s.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(o.WebVTT){return}if(l.body.contains(this.el())){if(!this.options_["vtt.js"]&&Eo(gt)&&Object.keys(gt).length>0){this.trigger("vttjsloaded");return}const t=l.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";t.onload=()=>{this.trigger("vttjsloaded")};t.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",(()=>{t.onload=null;t.onerror=null}));o.WebVTT=true;this.el().parentNode.appendChild(t)}else{this.ready(this.addWebVttScript_)}}emulateTextTracks(){const t=this.textTracks();const e=this.remoteTextTracks();const i=e=>t.addTrack(e.track);const s=e=>t.removeTrack(e.track);e.on("addtrack",i);e.on("removetrack",s);this.addWebVttScript_();const n=()=>this.trigger("texttrackchange");const r=()=>{n();for(let e=0;e<t.length;e++){const i=t[e];i.removeEventListener("cuechange",n);if(i.mode==="showing"){i.addEventListener("cuechange",n)}}};r();t.addEventListener("change",r);t.addEventListener("addtrack",r);t.addEventListener("removetrack",r);this.on("dispose",(function(){e.off("addtrack",i);e.off("removetrack",s);t.removeEventListener("change",r);t.removeEventListener("addtrack",r);t.removeEventListener("removetrack",r);for(let e=0;e<t.length;e++){const i=t[e];i.removeEventListener("cuechange",n)}}))}addTextTrack(t,e,i){if(!t){throw new Error("TextTrack kind is required but was not provided")}return vu(this,t,e,i)}createRemoteTextTrack(t){const e=Io(t,{tech:this});return new pu.remoteTextEl.TrackClass(e)}addRemoteTextTrack(t={},e){const i=this.createRemoteTextTrack(t);if(typeof e!=="boolean"){e=false}this.remoteTextTrackEls().addTrackElement_(i);this.remoteTextTracks().addTrack(i.track);if(e===false){this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track)))}return i}removeRemoteTextTrack(t){const e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e);this.remoteTextTracks().removeTrack(t);this.autoRemoteTextTracks_.removeTrack(t)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return true}setDisablePictureInPicture(){}requestVideoFrameCallback(t){const e=Ua();if(!this.isReady_||this.paused()){this.queuedHanders_.add(e);this.one("playing",(()=>{if(this.queuedHanders_.has(e)){this.queuedHanders_.delete(e);t()}}))}else{this.requestNamedAnimationFrame(e,t)}return e}cancelVideoFrameCallback(t){if(this.queuedHanders_.has(t)){this.queuedHanders_.delete(t)}else{this.cancelNamedAnimationFrame(t)}}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(t){}overrideNativeVideoTracks(t){}canPlayType(t){return""}static canPlayType(t){return""}static canPlaySource(t,e){return gu.canPlayType(t.type)}static isTech(t){return t.prototype instanceof gu||t instanceof gu||t===gu}static registerTech(t,e){if(!gu.techs_){gu.techs_={}}if(!gu.isTech(e)){throw new Error(`Tech ${t} must be a Tech`)}if(!gu.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!gu.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}t=bh(t);gu.techs_[t]=e;gu.techs_[yh(t)]=e;if(t!=="Tech"){gu.defaultTechOrder_.push(t)}return e}static getTech(t){if(!t){return}if(gu.techs_&&gu.techs_[t]){return gu.techs_[t]}t=bh(t);if(o&&o.videojs&&o.videojs[t]){go.warn(`The ${t} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);return o.videojs[t]}}}mu.names.forEach((function(t){const e=mu[t];gu.prototype[e.getterName]=function(){this[e.privateName]=this[e.privateName]||new e.ListClass;return this[e.privateName]}}));gu.prototype.featuresVolumeControl=true;gu.prototype.featuresMuteControl=true;gu.prototype.featuresFullscreenResize=false;gu.prototype.featuresPlaybackRate=false;gu.prototype.featuresProgressEvents=false;gu.prototype.featuresSourceset=false;gu.prototype.featuresTimeupdateEvents=false;gu.prototype.featuresNativeTextTracks=false;gu.prototype.featuresVideoFrameCallback=false;gu.withSourceHandlers=function(t){t.registerSourceHandler=function(e,i){let s=t.sourceHandlers;if(!s){s=t.sourceHandlers=[]}if(i===undefined){i=s.length}s.splice(i,0,e)};t.canPlayType=function(e){const i=t.sourceHandlers||[];let s;for(let t=0;t<i.length;t++){s=i[t].canPlayType(e);if(s){return s}}return""};t.selectSourceHandler=function(e,i){const s=t.sourceHandlers||[];let n;for(let t=0;t<s.length;t++){n=s[t].canHandleSource(e,i);if(n){return s[t]}}return null};t.canPlaySource=function(e,i){const s=t.selectSourceHandler(e,i);if(s){return s.canHandleSource(e,i)}return""};const e=["seekable","seeking","duration"];e.forEach((function(t){const e=this[t];if(typeof e!=="function"){return}this[t]=function(){if(this.sourceHandler_&&this.sourceHandler_[t]){return this.sourceHandler_[t].apply(this.sourceHandler_,arguments)}return e.apply(this,arguments)}}),t.prototype);t.prototype.setSource=function(e){let i=t.selectSourceHandler(e,this.options_);if(!i){if(t.nativeSourceHandler){i=t.nativeSourceHandler}else{go.error("No source handler found for the current source.")}}this.disposeSourceHandler();this.off("dispose",this.disposeSourceHandler_);if(i!==t.nativeSourceHandler){this.currentSource_=e}this.sourceHandler_=i.handleSource(e,this,this.options_);this.one("dispose",this.disposeSourceHandler_)};t.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}}};Sh.registerComponent("Tech",gu);gu.registerTech("Tech",gu);gu.defaultTechOrder_=[];const yu={};const bu={};const wu={};function Tu(t,e){yu[t]=yu[t]||[];yu[t].push(e)}function Su(t,e,i){t.setTimeout((()=>Ou(e,yu[e.type],i,t)),1)}function ku(t,e){t.forEach((t=>t.setTech&&t.setTech(e)))}function Eu(t,e,i){return t.reduceRight(ju(i),e[i]())}function Iu(t,e,i,s){return e[i](t.reduce(ju(i),s))}function xu(t,e,i,s=null){const n="call"+bh(i);const r=t.reduce(ju(n),s);const o=r===wu;const a=o?null:e[i](r);_u(t,i,a,o);return a}const Au={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1};const Du={setCurrentTime:1,setMuted:1,setVolume:1};const Cu={play:1,pause:1};function ju(t){return(e,i)=>{if(e===wu){return wu}if(i[t]){return i[t](e)}return e}}function _u(t,e,i,s){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r[e]){r[e](s,i)}}}function Nu(t){bu[t.id()]=null}function Mu(t,e){const i=bu[t.id()];let s=null;if(i===undefined||i===null){s=e(t);bu[t.id()]=[[e,s]];return s}for(let t=0;t<i.length;t++){const[n,r]=i[t];if(n!==e){continue}s=r}if(s===null){s=e(t);i.push([e,s])}return s}function Ou(t={},e=[],i,s,n=[],r=false){const[o,...a]=e;if(typeof o==="string"){Ou(t,yu[o],i,s,n,r)}else if(o){const e=Mu(s,o);if(!e.setSource){n.push(e);return Ou(t,a,i,s,n,r)}e.setSource(Object.assign({},t),(function(o,h){if(o){return Ou(t,a,i,s,n,r)}n.push(e);Ou(h,t.type===h.type?a:yu[h.type],i,s,n,r)}))}else if(a.length){Ou(t,a,i,s,n,r)}else if(r){i(t,n)}else{Ou(t,yu["*"],i,s,n,true)}}const Lu={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 Ru=function(t=""){const e=nu(t);const i=Lu[e.toLowerCase()];return i||""};const $u=(t,e)=>{if(!e){return""}if(t.cache_.source.src===e&&t.cache_.source.type){return t.cache_.source.type}const i=t.cache_.sources.filter((t=>t.src===e));if(i.length){return i[0].type}const s=t.$$("source");for(let t=0;t<s.length;t++){const i=s[t];if(i.type&&i.src&&i.src===e){return i.type}}return Ru(e)};const Pu=function(t){if(Array.isArray(t)){let e=[];t.forEach((function(t){t=Pu(t);if(Array.isArray(t)){e=e.concat(t)}else if(ko(t)){e.push(t)}}));t=e}else if(typeof t==="string"&&t.trim()){t=[Uu({src:t})]}else if(ko(t)&&typeof t.src==="string"&&t.src&&t.src.trim()){t=[Uu(t)]}else{t=[]}return t};function Uu(t){if(!t.type){const e=Ru(t.src);if(e){t.type=e}}return t}var Fu='<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 16 16" id="vjs-icon-play">\n <path d="M2 1v14l12-7z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-pause">\n <path d="M10 4H5v16h5V4zm9 0h-5v16h5V4z"/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-audio">\n <g><rect fill=\'none\' height=\'24\' width=\'24\'/></g><g><path d=\'M12,3c-4.97,0-9,4.03-9,9v7c0,1.1,0.9,2,2,2h4v-8H5v-1c0-3.87,3.13-7,7-7s7,3.13,7,7v1h-4v8h4c1.1,0,2-0.9,2-2v-7 C21,7.03,16.97,3,12,3z\'/></g>\n </symbol>\n <symbol viewBox="0 0 576 512" id="vjs-icon-captions">\n <path d=\'M0 96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-subtitles">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z\'/>\n </symbol>\n <symbol viewBox="0 0 448 512" id="vjs-icon-fullscreen-enter">\n <path d=\'M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-fullscreen-exit">\n <path d="M16,9h5a1,1,0,0,0,0-2H17V3a1,1,0,0,0-2,0V8A1,1,0,0,0,16,9ZM8,15H3a1,1,0,0,0,0,2H7v4a1,1,0,0,0,2,0V16A1,1,0,0,0,8,15ZM8,2A1,1,0,0,0,7,3V7H3A1,1,0,0,0,3,9H8A1,1,0,0,0,9,8V3A1,1,0,0,0,8,2ZM21,15H16a1,1,0,0,0-1,1v5a1,1,0,0,0,2,0V17h4a1,1,0,0,0,0-2Z"/>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-play-circle">\n <path d=\'M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c7.6-4.2 16.8-4.1 24.3 .5l144 88c7.1 4.4 11.5 12.1 11.5 20.5s-4.4 16.1-11.5 20.5l-144 88c-7.4 4.5-16.7 4.7-24.3 .5s-12.3-12.2-12.3-20.9V168c0-8.7 4.7-16.7 12.3-20.9z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-volume-mute">\n <path d=\'M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-volume-low">\n <path d="M0 0h24v24H0z" fill="none"/><path d="M7 9v6h4l5 5V4l-5 5H7z"/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-volume-medium">\n <path d="M0 0h24v24H0z" fill="none"/><path d="M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z"/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-volume-high">\n <path d="M0 0h24v24H0z" fill="none"/><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-spinner">\n <path d=\'M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d=\'M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 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\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-chapters">\n <path d=\'M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-downloading">\n <path d=\'M18.32,4.26C16.84,3.05,15.01,2.25,13,2.05v2.02c1.46,0.18,2.79,0.76,3.9,1.62L18.32,4.26z M19.93,11h2.02 c-0.2-2.01-1-3.84-2.21-5.32L18.31,7.1C19.17,8.21,19.75,9.54,19.93,11z M18.31,16.9l1.43,1.43c1.21-1.48,2.01-3.32,2.21-5.32 h-2.02C19.75,14.46,19.17,15.79,18.31,16.9z M13,19.93v2.02c2.01-0.2,3.84-1,5.32-2.21l-1.43-1.43 C15.79,19.17,14.46,19.75,13,19.93z M15.59,10.59L13,13.17V7h-2v6.17l-2.59-2.59L7,12l5,5l5-5L15.59,10.59z M11,19.93v2.02 c-5.05-0.5-9-4.76-9-9.95s3.95-9.45,9-9.95v2.02C7.05,4.56,4,7.92,4,12S7.05,19.44,11,19.93z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-file-download">\n <path d=\'M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-file-download-done">\n <polygon points=\'20.13,5.41 18.72,4 9.53,13.19 5.28,8.95 3.87,10.36 9.53,16.02\'/><rect height=\'2\' width=\'14\' x=\'5\' y=\'18\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-file-download-off">\n <path d=\'M18,15.17V15h2v2.17L18,15.17z M15.41,12.59L17,11l-1.41-1.41L14,11.17L15.41,12.59z M13,10.17V4h-2v4.17L13,10.17z M21.19,21.19l-1.78-1.78L2.81,2.81L1.39,4.22l6.19,6.19L7,11l5,5l0.59-0.59L15.17,18H6v-3H4v3c0,1.1,0.9,2,2,2h11.17l2.61,2.61 L21.19,21.19z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-share">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-cog">\n <path d=\'M0,0h24v24H0V0z\' fill=\'none\'/><path d=\'M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z\'/>\n </symbol>\n <symbol viewBox="0 0 448 512" id="vjs-icon-square">\n <path d=\'M384 80c8.8 0 16 7.2 16 16V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16H384zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z\'/>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-circle">\n <path d=\'M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-circle-outline">\n <path d=\'M12,2C6.47,2,2,6.47,2,12c0,5.53,4.47,10,10,10s10-4.47,10-10C22,6.47,17.53,2,12,2z M12,20c-4.42,0-8-3.58-8-8 c0-4.42,3.58-8,8-8s8,3.58,8,8C20,16.42,16.42,20,12,20z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-circle-inner-circle">\n <path d=\'M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3-8c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-cancel">\n <path d=\'M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-repeat">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-replay">\n <path d=\'M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z\'/>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d=\'m17.68852 98-8.69633 8.69633 8.69633 8.69634 2.48665-2.48434-4.31928-4.31928h1.3011c4.93015 0 9.07149 1.72189 12.42399 5.16511 3.35251 3.44322 5.02876 7.63753 5.02876 12.58345h3.54972c0-2.95809-.55264-5.7293-1.657-8.3127-1.10435-2.5834-2.62238-4.84095-4.555-6.77357-1.93262-1.93262-4.19017-3.45065-6.77357-4.55501-2.5834-1.10435-5.35462-1.65699-8.31271-1.65699H15.5l4.61508-4.61509zm-8.07929 21.65879v13.86144h11.35631v5.00796H9.60923V143h12.699c.83466 0 1.55075-.29818 2.14693-.89436.59619-.59619.89436-1.30996.89436-2.14462v-7.78117c0-.83466-.29817-1.55075-.89436-2.14693-.59618-.59618-1.31227-.89436-2.14693-.89436h-8.22719v-5.09578h11.26848v-4.38399z\'/>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d=\'M42.314792 125.62978c0-4.99676-1.693476-9.23445-5.080438-12.71305-3.386962-3.47861-7.570851-5.21791-12.551676-5.21791h-1.314946l4.363203 4.3632-2.510335 2.51034-8.786174-8.78619L25.2206 97l2.450567 2.45057-4.662053 4.66205h1.374714c2.988489 0 5.787713.55785 8.397671 1.67355 2.609949 1.11571 4.891163 2.64981 6.843654 4.60229 1.952481 1.95248 3.486576 4.2337 4.602275 6.84365 1.115709 2.60995 1.673563 5.40917 1.673563 8.39767zM8.1829433 142v-19.65677H3.17603v-4.5433h9.642939V142Zm13.6299297 0c-1.155923 0-2.126398-.39251-2.911424-1.17755-.778861-.77885-1.168286-1.74624-1.168286-2.90215v-16.04066c0-1.15593.392524-2.1264 1.17755-2.91144.77886-.77885 1.746237-1.16827 2.90216-1.16827h7.695814c1.155914 0 2.126388.39251 2.911425 1.17755.77885.77886 1.168275 1.74623 1.168275 2.90216v16.04066c0 1.15591-.392513 2.12639-1.177549 2.91142-.778851.77885-1.746237 1.16828-2.902151 1.16828Zm.556316-4.63603h6.583172v-15.02074h-6.583172z\'/>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d=\'m26.046875 97-8.732422 8.73242 8.732422 8.73242 2.496094-2.49414-4.335938-4.33789h1.306641c4.950749 0 9.108097 1.72991 12.474609 5.1875 3.366504 3.4576 5.050781 7.66818 5.050781 12.63477h3.564454c0-2.97045-.555098-5.75152-1.664063-8.3457-1.108965-2.59419-2.633522-4.86205-4.574219-6.80274-1.940688-1.94069-4.208545-3.46525-6.802734-4.57422-2.59419-1.10897-5.375262-1.66406-8.345703-1.66406h-1.367188l4.634766-4.63477zM2.5546875 117.53125v4.6875H12.851562v5.25H5.8730469v4.6875h6.9785151v5.15625H2.5546875V142H13.361328c1.06088 0 1.950319-.39495 2.667969-1.18555.71765-.79059 1.076172-1.7727 1.076172-2.9414v-16.2168c0-1.1687-.358522-2.14886-1.076172-2.93945-.71765-.79059-1.607089-1.18555-2.667969-1.18555zm22.4824215.14063c-1.148936 0-2.110612.38991-2.884765 1.16406-.780292.78029-1.171875 1.74365-1.171875 2.89258v15.94336c0 1.14892.387966 2.1106 1.162109 2.88476.780302.78029 1.745595 1.17188 2.894531 1.17188h7.648438c1.148936 0 2.110613-.38795 2.884765-1.16211.780294-.78029 1.169922-1.74561 1.169922-2.89453v-15.94336c0-1.14893-.386013-2.11061-1.160156-2.88477-.780293-.78029-1.745595-1.17187-2.894531-1.17187zm.552735 4.51757h6.544922v14.92969h-6.544922z\'/>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d=\'m29.50843 97-2.43193 2.42962 4.6253 4.6253h-1.3642c-2.96464 0-5.74198.55386-8.3311 1.66066-2.58912 1.1068-4.85167 2.62819-6.78857 4.56508-1.93689 1.9369-3.45828 4.19945-4.56508 6.78857-1.1068 2.58911-1.66066 5.36646-1.66066 8.3311h3.55757c0-4.95687 1.67996-9.16047 5.03989-12.6113 3.35992-3.45084 7.51042-5.17654 12.45149-5.17654h1.30398l-4.32653 4.32883 2.48984 2.48984 8.71558-8.71558zm-9.78332 21.60945v13.8898h11.38144v5.01905H19.72511V142h12.72711c.83651 0 1.55186-.29884 2.14937-.89634.5975-.59751.89634-1.31286.89634-2.14936v-7.7984c0-.83651-.29884-1.55418-.89634-2.15168-.59751-.5975-1.31286-.89634-2.14937-.89634h-8.2454v-5.10706h11.29111v-4.39137z\'/>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d=\'m23.118923 97-2.385761 2.38349 4.537491 4.53749h-1.338298c-2.908354 0-5.632974.54335-8.172936 1.62913-2.539963 1.08579-4.759558 2.57829-6.659682 4.47842-1.900125 1.90012-3.39263 4.11972-4.478415 6.65968-1.085785 2.53996-1.629134 5.26458-1.629134 8.17294h3.490028c0-4.86277 1.648071-8.98656 4.944206-12.37188 3.296134-3.38532 7.367841-5.07826 12.215097-5.07826h1.279222l-4.244383 4.24665 2.442565 2.44257 8.550114-8.55012zm-9.520322 21.44913v4.42161h4.871497V142h4.512496v-23.55087zm18.136328 0c-1.124919 0-2.06632.37811-2.824287 1.13608-.763982.76398-1.147437 1.70845-1.147437 2.83337v15.61197c0 1.12492.380382 2.06631 1.138349 2.82428.763983.76398 1.708456 1.14517 2.833375 1.14517h7.489021c1.12492 0 2.06632-.37811 2.82428-1.13608.76399-.76398 1.14517-1.70845 1.14517-2.83337v-15.61197c0-1.12492-.37811-2.06632-1.13608-2.82429-.76398-.76398-1.70845-1.14516-2.83337-1.14516zm.540773 4.42161h6.407468v14.61676h-6.407468z\'/>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d=\'m25.548631 97-2.436697 2.43438 4.634367 4.63436H26.37943c-2.970448 0-5.753239.55495-8.347429 1.66392-2.594191 1.10897-4.861176 2.63334-6.801867 4.57403-1.940693 1.94069-3.465063 4.20767-4.57403 6.80187-1.108967 2.59419-1.663916 5.37698-1.663916 8.34742h3.56454c0-4.96658 1.683258-9.17841 5.049766-12.63601 3.366507-3.4576 7.525145-5.18669 12.475891-5.18669h1.306534l-4.335002 4.33733 2.494714 2.49471 8.73266-8.73266zm-11.552266 20.53092v4.68774h10.296787v5.24934h-6.978237v4.68774h6.978237v5.15652H13.996365V142h10.807333c1.060879 0 1.94879-.39527 2.666443-1.18586.717653-.79059 1.076789-1.77158 1.076789-2.94028v-16.2168c0-1.1687-.359136-2.14969-1.076789-2.94028-.717653-.79059-1.605564-1.18586-2.666443-1.18586zm21.173741.16708c-1.148937 0-2.110436.38851-2.884586 1.16266-.780294.78029-1.171935 1.74493-1.171935 2.89387v15.94296c0 1.14894.388502 2.11043 1.162652 2.88458.780294.78029 1.744932 1.16962 2.893869 1.16962h7.648904c1.14894 0 2.11044-.38619 2.88459-1.16033.78029-.7803 1.16961-1.74493 1.16961-2.89387v-15.94296c0-1.14894-.38618-2.11044-1.16033-2.88459-.78029-.78029-1.74493-1.17194-2.89387-1.17194zm.552317 4.51602h6.541957v14.93115h-6.541957z\'/>\n </symbol>\n <symbol viewBox="0 0 512 512" xmlns:sketch=\'http://www.bohemiancoding.com/sketch/ns\' id="vjs-icon-audio-description">\n <g id=\'Page-1\' stroke=\'none\' stroke-width=\'1\' sketch:type=\'MSPage\'><g id=\'AD\' sketch:type=\'MSArtboardGroup\'><g id=\'g24\' sketch:type=\'MSLayerGroup\' transform=\'translate(226.904216, 162.124958)\'><path d=\'M0.385466989,219.226204 L0.385466989,0.867948105 C50.7660025,-0.149278544 89.4938709,-2.16027378 118.016886,17.9940357 C145.39121,37.3362698 166.750707,74.9591545 162.906445,123.318579 C158.839382,174.474203 121.571663,217.457893 73.1311827,221.793795 C49.0460488,223.949377 1.1583283,221.793795 1.1583283,221.793795 C1.1583283,221.793795 0.318395733,220.441758 0.385466989,219.226204 M49.1404882,164.421786 C80.5703101,165.681697 102.34881,147.788744 105.636072,119.036417 C110.038491,80.5268177 84.4473371,55.4838492 47.5943801,58.2399576 L47.5943801,161.852062 C47.5585317,163.318404 48.1702678,164.071194 49.1404882,164.421786\' id=\'path26\' sketch:type=\'MSShapeGroup\'></path></g><g id=\'g28\' sketch:type=\'MSLayerGroup\' transform=\'translate(383.779991, 168.926023)\'><path d=\'M0,212.402042 C13.3360014,216.111401 17.386874,201.342635 23.2151349,190.99422 C35.936702,168.422877 45.5086182,139.400143 45.6604922,106.220214 C45.8813648,58.6259492 27.3172746,23.7033002 10.059532,0.0383859113 L1.54919183,0.0383859113 C0.96289654,3.91152436 3.77564916,7.35260805 5.41542574,10.3142944 C18.5814362,34.0755999 30.7818519,66.8674044 30.9556975,104.507776 C31.1545985,147.683822 16.7932549,183.786198 0,212.402042\' id=\'path30\' sketch:type=\'MSShapeGroup\'></path></g><g id=\'g32\' sketch:type=\'MSLayerGroup\' transform=\'translate(425.153705, 168.926023)\'><path d=\'M0,212.402042 C13.3360014,216.111401 17.3841758,201.340502 23.2151349,190.99422 C35.936702,168.422877 45.5066909,139.400143 45.6604922,106.220214 C45.8813648,58.6259492 27.3172746,23.7033002 10.059532,0.0383859113 L1.54919183,0.0383859113 C0.96289654,3.91152436 3.77487823,7.35346107 5.41542574,10.3142944 C18.5814362,34.0755999 30.7822374,66.8674044 30.9556975,104.507776 C31.1545985,147.683822 16.7932549,183.786198 0,212.402042\' id=\'path34\' sketch:type=\'MSShapeGroup\'></path></g><g id=\'g36\' sketch:type=\'MSLayerGroup\' transform=\'translate(466.260868, 168.926023)\'><path d=\'M0,212.402042 C13.3360014,216.111401 17.3841758,201.340502 23.2151349,190.99422 C35.936702,168.422877 45.5066909,139.400143 45.6604922,106.220214 C45.8813648,58.6259492 27.3172746,23.7033002 10.059532,0.0383859113 L1.54919183,0.0383859113 C0.96289654,3.91152436 3.77487823,7.35303456 5.41542574,10.3142944 C18.5814362,34.0755999 30.7818519,66.8674044 30.9556975,104.507776 C31.1545985,147.683822 16.7932549,183.786198 0,212.402042\' id=\'path38\' sketch:type=\'MSShapeGroup\'></path></g><path d=\'M4.4765625,383.005158 L72.5800993,383.005158 L91.1530552,354.521486 L155.321745,354.386058 C155.321745,354.386058 155.386889,373.799083 155.386889,383.005158 L204.142681,383.005158 L204.142681,160.308263 L145.326586,160.308263 C139.673713,169.845383 4.4765625,383.005158 4.4765625,383.005158 L4.4765625,383.005158 Z M157.144233,237.722611 L157.144233,308.881058 L116.6914,308.610203 L157.144233,237.722611 L157.144233,237.722611 Z\' id=\'path22\' sketch:type=\'MSShapeGroup\'></path></g></g>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-next-item">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-previous-item">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M6 6h2v12H6zm3.5 6l8.5 6V6z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-shuffle">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-cast">\n <path d=\'M0 0h24v24H0z\' fill=\'none\'/><path d=\'M0 0h24v24H0z\' fill=\'none\' opacity=\'.1\'/><path d=\'M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z\'/>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-picture-in-picture-enter">\n <path d=\'M0 0h24v24H0V0z\' fill=\'none\'/><path d=\'M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z\'/>\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 fill=\'none\' d=\'M-1-3h24v24H-1z\'/>\n </symbol>\n <symbol viewBox="0 0 320 512" id="vjs-icon-facebook">\n <path d=\'M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z\'/>\n </symbol>\n <symbol viewBox="0 0 448 512" id="vjs-icon-linkedin">\n <path d=\'M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z\'/>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-twitter">\n <path d=\'M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z\'/>\n </symbol>\n <symbol viewBox="0 0 320 512" id="vjs-icon-tumblr">\n <path d=\'M309.8 480.3c-13.6 14.5-50 31.7-97.4 31.7-120.8 0-147-88.8-147-140.6v-144H17.9c-5.5 0-10-4.5-10-10v-68c0-7.2 4.5-13.6 11.3-16 62-21.8 81.5-76 84.3-117.1.8-11 6.5-16.3 16.1-16.3h70.9c5.5 0 10 4.5 10 10v115.2h83c5.5 0 10 4.4 10 9.9v81.7c0 5.5-4.5 10-10 10h-83.4V360c0 34.2 23.7 53.6 68 35.8 4.8-1.9 9-3.2 12.7-2.2 3.5.9 5.8 3.4 7.4 7.9l22 64.3c1.8 5 3.3 10.6-.4 14.5z\'/>\n </symbol>\n <symbol viewBox="0 0 496 512" id="vjs-icon-pinterest">\n <path d=\'M496 256c0 137-111 248-248 248-25.6 0-50.2-3.9-73.4-11.1 10.1-16.5 25.2-43.5 30.8-65 3-11.6 15.4-59 15.4-59 8.1 15.4 31.7 28.5 56.8 28.5 74.8 0 128.7-68.8 128.7-154.3 0-81.9-66.9-143.2-152.9-143.2-107 0-163.9 71.8-163.9 150.1 0 36.4 19.4 81.7 50.3 96.1 4.7 2.2 7.2 1.2 8.3-3.3.8-3.4 5-20.3 6.9-28.1.6-2.5.3-4.7-1.7-7.1-10.1-12.5-18.3-35.3-18.3-56.6 0-54.7 41.4-107.6 112-107.6 60.9 0 103.6 41.5 103.6 100.9 0 67.1-33.9 113.6-78 113.6-24.3 0-42.6-20.1-36.7-44.8 7-29.5 20.5-61.3 20.5-82.6 0-19-10.2-34.9-31.4-34.9-24.9 0-44.9 25.7-44.9 60.2 0 22 7.4 36.8 7.4 36.8s-24.5 103.8-29 123.2c-5 21.4-3 51.6-.9 71.2C65.4 450.9 0 361.1 0 256 0 119 111 8 248 8s248 111 248 248z\'/>\n </symbol>\n </defs>\n</svg>';class Bu extends Sh{constructor(t,e,i){const s=Io({createEl:false},e);super(t,s,i);if(!e.playerOptions.sources||e.playerOptions.sources.length===0){for(let i=0,s=e.playerOptions.techOrder;i<s.length;i++){const e=bh(s[i]);let n=gu.getTech(e);if(!e){n=Sh.getComponent(e)}if(n&&n.isSupported()){t.loadTech_(e);break}}}else{t.src(e.playerOptions.sources)}}}Sh.registerComponent("MediaLoader",Bu);class qu extends Sh{constructor(t,e){super(t,e);if(this.options_.controlText){this.controlText(this.options_.controlText)}this.handleMouseOver_=t=>this.handleMouseOver(t);this.handleMouseOut_=t=>this.handleMouseOut(t);this.handleClick_=t=>this.handleClick(t);this.handleKeyDown_=t=>this.handleKeyDown(t);this.emitTapEvents();this.enable()}createEl(t="div",e={},i={}){e=Object.assign({className:this.buildCSSClass(),tabIndex:0},e);if(t==="button"){go.error(`Creating a ClickableComponent with an HTML element of ${t} is not supported; use a Button instead.`)}i=Object.assign({role:"button"},i);this.tabIndex_=e.tabIndex;const s=ea(t,e,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(ea("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(t){this.controlTextEl_=ea("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(t){t.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,t);return this.controlTextEl_}controlText(t,e=this.el()){if(t===undefined){return this.controlText_||"Need Text"}const i=this.localize(t);this.controlText_=t;ia(this.controlTextEl_,i);if(!this.nonIconControl&&!this.player_.options_.noUITitleAttributes){e.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(t){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}}handleKeyDown(t){if(d.isEventKey(t,"Space")||d.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.trigger("click")}else{super.handleKeyDown(t)}}}Sh.registerComponent("ClickableComponent",qu);class Vu extends qu{constructor(t,e){super(t,e);this.update();this.update_=t=>this.update(t);t.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return ea("div",{className:"vjs-poster"})}crossOrigin(t){if(typeof t==="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(t!==null&&t!=="anonymous"&&t!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${t}"`);return}if(this.$("img")){this.$("img").crossOrigin=t}return}update(t){const e=this.player().poster();this.setSrc(e);if(e){this.show()}else{this.hide()}}setSrc(t){if(!t){this.el_.textContent="";return}if(!this.$("img")){this.el_.appendChild(ea("picture",{className:"vjs-poster",tabIndex:-1},{},ea("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})))}this.$("img").src=t}handleClick(t){if(!this.player_.controls()){return}if(this.player_.tech(true)){this.player_.tech(true).focus()}if(this.player_.paused()){Rh(this.player_.play())}else{this.player_.pause()}}}Vu.prototype.crossorigin=Vu.prototype.crossOrigin;Sh.registerComponent("PosterImage",Vu);const Hu="#222";const zu="#ccc";const Xu={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 Gu(t,e){let i;if(t.length===4){i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]}else if(t.length===7){i=t.slice(1)}else{throw new Error("Invalid color code provided, "+t+"; 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)+","+e+")"}function Wu(t,e,i){try{t.style[e]=i}catch(t){return}}function Yu(t){return t?`${t}px`:""}class Ku extends Sh{constructor(t,e,i){super(t,e,i);const s=t=>this.updateDisplay(t);const n=t=>{this.updateDisplayOverlay();this.updateDisplay(t)};t.on("loadstart",(t=>this.toggleDisplay(t)));t.on("texttrackchange",s);t.on("loadedmetadata",(t=>{this.updateDisplayOverlay();this.preselectTrack(t)}));t.ready(Za(this,(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks){this.hide();return}t.on("fullscreenchange",n);t.on("playerresize",n);const e=o.screen.orientation||o;const i=o.screen.orientation?"change":"orientationchange";e.addEventListener(i,n);t.on("dispose",(()=>e.removeEventListener(i,n)));const s=this.options_.playerOptions.tracks||[];for(let t=0;t<s.length;t++){this.player_.addRemoteTextTrack(s[t],true)}this.preselectTrack()})))}preselectTrack(){const t={captions:1,subtitles:1};const e=this.player_.textTracks();const i=this.player_.cache_.selectedLanguage;let s;let n;let r;for(let o=0;o<e.length;o++){const a=e[o];if(i&&i.enabled&&i.language&&i.language===a.language&&a.kind in t){if(a.kind===i.kind){r=a}else if(!r){r=a}}else if(i&&!i.enabled){r=null;s=null;n=null}else if(a.default){if(a.kind==="descriptions"&&!s){s=a}else if(a.kind in t&&!n){n=a}}}if(r){r.mode="showing"}else if(n){n.mode="showing"}else if(s){s.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 o.WebVTT==="function"){o.WebVTT.processCues(o,[],this.el_)}}updateDisplay(){const t=this.player_.textTracks();const e=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(e){const e=[];for(let i=0;i<t.length;++i){const s=t[i];if(s.mode!=="showing"){continue}e.push(s)}this.updateForTrack(e);return}let i=null;let s=null;let n=t.length;while(n--){const e=t[n];if(e.mode==="showing"){if(e.kind==="descriptions"){i=e}else{s=e}}}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)}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!o.CSS.supports("inset-inline: 10px")){return}const t=this.player_.currentWidth();const e=this.player_.currentHeight();const i=t/e;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((t-e*s)/2)}else{r=Math.round((e-t/s)/2)}}Wu(this.el_,"insetInline",Yu(n));Wu(this.el_,"insetBlock",Yu(r))}updateDisplayState(t){const e=this.player_.textTrackSettings.getValues();const i=t.activeCues;let s=i.length;while(s--){const t=i[s];if(!t){continue}const n=t.displayState;if(e.color){n.firstChild.style.color=e.color}if(e.textOpacity){Wu(n.firstChild,"color",Gu(e.color||"#fff",e.textOpacity))}if(e.backgroundColor){n.firstChild.style.backgroundColor=e.backgroundColor}if(e.backgroundOpacity){Wu(n.firstChild,"backgroundColor",Gu(e.backgroundColor||"#000",e.backgroundOpacity))}if(e.windowColor){if(e.windowOpacity){Wu(n,"backgroundColor",Gu(e.windowColor,e.windowOpacity))}else{n.style.backgroundColor=e.windowColor}}if(e.edgeStyle){if(e.edgeStyle==="dropshadow"){n.firstChild.style.textShadow=`2px 2px 3px ${Hu}, 2px 2px 4px ${Hu}, 2px 2px 5px ${Hu}`}else if(e.edgeStyle==="raised"){n.firstChild.style.textShadow=`1px 1px ${Hu}, 2px 2px ${Hu}, 3px 3px ${Hu}`}else if(e.edgeStyle==="depressed"){n.firstChild.style.textShadow=`1px 1px ${zu}, 0 1px ${zu}, -1px -1px ${Hu}, 0 -1px ${Hu}`}else if(e.edgeStyle==="uniform"){n.firstChild.style.textShadow=`0 0 4px ${Hu}, 0 0 4px ${Hu}, 0 0 4px ${Hu}, 0 0 4px ${Hu}`}}if(e.fontPercent&&e.fontPercent!==1){const t=o.parseFloat(n.style.fontSize);n.style.fontSize=t*e.fontPercent+"px";n.style.height="auto";n.style.top="auto"}if(e.fontFamily&&e.fontFamily!=="default"){if(e.fontFamily==="small-caps"){n.firstChild.style.fontVariant="small-caps"}else{n.firstChild.style.fontFamily=Xu[e.fontFamily]}}}}updateForTrack(t){if(!Array.isArray(t)){t=[t]}if(typeof o.WebVTT!=="function"||t.every((t=>!t.activeCues))){return}const e=[];for(let i=0;i<t.length;++i){const s=t[i];for(let t=0;t<s.activeCues.length;++t){e.push(s.activeCues[t])}}o.WebVTT.processCues(o,e,this.el_);for(let e=0;e<t.length;++e){const i=t[e];for(let t=0;t<i.activeCues.length;++t){const s=i.activeCues[t].displayState;ra(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:e));if(i.language){fa(s,"lang",i.language)}}if(this.player_.textTrackSettings){this.updateDisplayState(i)}}}}Sh.registerComponent("TextTrackDisplay",Ku);class Qu extends Sh{createEl(){const t=this.player_.isAudio();const e=this.localize(t?"Audio Player":"Video Player");const i=ea("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[e])});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"])}}Sh.registerComponent("LoadingSpinner",Qu);class Ju extends qu{createEl(t,e={},i={}){t="button";e=Object.assign({className:this.buildCSSClass()},e);i=Object.assign({type:"button"},i);const s=ea(t,e,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(ea("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}addChild(t,e={}){const i=this.constructor.name;go.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`);return Sh.prototype.addChild.call(this,t,e)}enable(){super.enable();this.el_.removeAttribute("disabled")}disable(){super.disable();this.el_.setAttribute("disabled","disabled")}handleKeyDown(t){if(d.isEventKey(t,"Space")||d.isEventKey(t,"Enter")){t.stopPropagation();return}super.handleKeyDown(t)}}Sh.registerComponent("Button",Ju);class Zu extends Ju{constructor(t,e){super(t,e);this.mouseused_=false;this.setIcon("play");this.on("mousedown",(t=>this.handleMouseDown(t)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(t){const e=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY){Rh(e);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(Lh(e)){e.then(n,(()=>{}))}else{this.setTimeout(n,1)}}handleKeyDown(t){this.mouseused_=false;super.handleKeyDown(t)}handleMouseDown(t){this.mouseused_=true}}Zu.prototype.controlText_="Play Video";Sh.registerComponent("BigPlayButton",Zu);class tc extends Ju{constructor(t,e){super(t,e);this.setIcon("cancel");this.controlText(e&&e.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(t){this.trigger({type:"close",bubbles:false})}handleKeyDown(t){if(d.isEventKey(t,"Esc")){t.preventDefault();t.stopPropagation();this.trigger("click")}else{super.handleKeyDown(t)}}}Sh.registerComponent("CloseButton",tc);class ec extends Ju{constructor(t,e={}){super(t,e);e.replay=e.replay===undefined||e.replay;this.setIcon("play");this.on(t,"play",(t=>this.handlePlay(t)));this.on(t,"pause",(t=>this.handlePause(t)));if(e.replay){this.on(t,"ended",(t=>this.handleEnded(t)))}}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(t){if(this.player_.paused()){Rh(this.player_.play())}else{this.player_.pause()}}handleSeeked(t){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(t)}else{this.handlePlay(t)}}handlePlay(t){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(t){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(t){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",(t=>this.handleSeeked(t)))}}ec.prototype.controlText_="Play";Sh.registerComponent("PlayToggle",ec);class ic extends Sh{constructor(t,e){super(t,e);this.on(t,["timeupdate","ended"],(t=>this.updateContent(t)));this.updateTextNode_()}createEl(){const t=this.buildCSSClass();const e=super.createEl("div",{className:`${t} vjs-time-control vjs-control`});const i=ea("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});e.appendChild(i);this.contentEl_=ea("span",{className:`${t}-display`},{role:"presentation"});e.appendChild(this.contentEl_);return e}dispose(){this.contentEl_=null;this.textNode_=null;super.dispose()}updateTextNode_(t=0){t=_h(t);if(this.formattedTime_===t){return}this.formattedTime_=t;this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_){return}let t=this.textNode_;if(t&&this.contentEl_.firstChild!==t){t=null;go.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_=l.createTextNode(this.formattedTime_);if(!this.textNode_){return}if(t){this.contentEl_.replaceChild(this.textNode_,t)}else{this.contentEl_.appendChild(this.textNode_)}}))}updateContent(t){}}ic.prototype.labelText_="Time";ic.prototype.controlText_="Time";Sh.registerComponent("TimeDisplay",ic);class sc extends ic{buildCSSClass(){return"vjs-current-time"}updateContent(t){let e;if(this.player_.ended()){e=this.player_.duration()}else{e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(e)}}sc.prototype.labelText_="Current Time";sc.prototype.controlText_="Current Time";Sh.registerComponent("CurrentTimeDisplay",sc);class nc extends ic{constructor(t,e){super(t,e);const i=t=>this.updateContent(t);this.on(t,"durationchange",i);this.on(t,"loadstart",i);this.on(t,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(t){const e=this.player_.duration();this.updateTextNode_(e)}}nc.prototype.labelText_="Duration";nc.prototype.controlText_="Duration";Sh.registerComponent("DurationDisplay",nc);class rc extends Sh{createEl(){const t=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":true});const e=super.createEl("div");const i=super.createEl("span",{textContent:"/"});e.appendChild(i);t.appendChild(e);return t}}Sh.registerComponent("TimeDivider",rc);class oc extends ic{constructor(t,e){super(t,e);this.on(t,"durationchange",(t=>this.updateContent(t)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const t=super.createEl();if(this.options_.displayNegative!==false){t.insertBefore(ea("span",{},{"aria-hidden":true},"-"),this.contentEl_)}return t}updateContent(t){if(typeof this.player_.duration()!=="number"){return}let e;if(this.player_.ended()){e=0}else if(this.player_.remainingTimeDisplay){e=this.player_.remainingTimeDisplay()}else{e=this.player_.remainingTime()}this.updateTextNode_(e)}}oc.prototype.labelText_="Remaining Time";oc.prototype.controlText_="Remaining Time";Sh.registerComponent("RemainingTimeDisplay",oc);class ac extends Sh{constructor(t,e){super(t,e);this.updateShowing();this.on(this.player(),"durationchange",(t=>this.updateShowing(t)))}createEl(){const t=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=ea("div",{className:"vjs-live-display"},{"aria-live":"off"});this.contentEl_.appendChild(ea("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `}));this.contentEl_.appendChild(l.createTextNode(this.localize("LIVE")));t.appendChild(this.contentEl_);return t}dispose(){this.contentEl_=null;super.dispose()}updateShowing(t){if(this.player().duration()===Infinity){this.show()}else{this.hide()}}}Sh.registerComponent("LiveDisplay",ac);class hc extends Ju{constructor(t,e){super(t,e);this.updateLiveEdgeStatus();if(this.player_.liveTracker){this.updateLiveEdgeStatusHandler_=t=>this.updateLiveEdgeStatus(t);this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}}createEl(){const t=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",t);this.textEl_=ea("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});t.appendChild(this.textEl_);return t}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()}}hc.prototype.controlText_="Seek to live, currently playing live";Sh.registerComponent("SeekToLive",hc);function uc(t,e,i){t=Number(t);return Math.min(i,Math.max(e,isNaN(t)?e:t))}var cc=Object.freeze({__proto__:null,clamp:uc});class fc extends Sh{constructor(t,e){super(t,e);this.handleMouseDown_=t=>this.handleMouseDown(t);this.handleMouseUp_=t=>this.handleMouseUp(t);this.handleKeyDown_=t=>this.handleKeyDown(t);this.handleClick_=t=>this.handleClick(t);this.handleMouseMove_=t=>this.handleMouseMove(t);this.update_=t=>this.update(t);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 t=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(t,"mousemove",this.handleMouseMove_);this.off(t,"mouseup",this.handleMouseUp_);this.off(t,"touchmove",this.handleMouseMove_);this.off(t,"touchend",this.handleMouseUp_);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false}createEl(t,e={},i={}){e.className=e.className+" vjs-slider";e=Object.assign({tabIndex:0},e);i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i);return super.createEl(t,e,i)}handleMouseDown(t){const e=this.bar.el_.ownerDocument;if(t.type==="mousedown"){t.preventDefault()}if(t.type==="touchstart"&&!Ro){t.preventDefault()}da();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(e,"mousemove",this.handleMouseMove_);this.on(e,"mouseup",this.handleMouseUp_);this.on(e,"touchmove",this.handleMouseMove_);this.on(e,"touchend",this.handleMouseUp_);this.handleMouseMove(t,true)}handleMouseMove(t){}handleMouseUp(t){const e=this.bar.el_.ownerDocument;pa();this.removeClass("vjs-sliding");this.trigger("sliderinactive");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.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(uc(this.getPercent(),0,1).toFixed(4))}calculateDistance(t){const e=ga(this.el_,t);if(this.vertical()){return e.y}return e.x}handleKeyDown(t){if(d.isEventKey(t,"Left")||d.isEventKey(t,"Down")){t.preventDefault();t.stopPropagation();this.stepBack()}else if(d.isEventKey(t,"Right")||d.isEventKey(t,"Up")){t.preventDefault();t.stopPropagation();this.stepForward()}else{super.handleKeyDown(t)}}handleClick(t){t.stopPropagation();t.preventDefault()}vertical(t){if(t===undefined){return this.vertical_||false}this.vertical_=!!t;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}}}Sh.registerComponent("Slider",fc);const lc=(t,e)=>uc(t/e*100,0,100).toFixed(2)+"%";class dc extends Sh{constructor(t,e){super(t,e);this.partEls_=[];this.on(t,"progress",(t=>this.update(t)))}createEl(){const t=super.createEl("div",{className:"vjs-load-progress"});const e=ea("span",{className:"vjs-control-text"});const i=ea("span",{textContent:this.localize("Loaded")});const s=l.createTextNode(": ");this.percentageEl_=ea("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});t.appendChild(e);e.appendChild(i);e.appendChild(s);e.appendChild(this.percentageEl_);return t}dispose(){this.partEls_=null;this.percentageEl_=null;super.dispose()}update(t){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const t=this.player_.liveTracker;const e=this.player_.buffered();const i=t&&t.isLive()?t.seekableEnd():this.player_.duration();const s=this.player_.bufferedEnd();const n=this.partEls_;const r=lc(s,i);if(this.percent_!==r){this.el_.style.width=r;ia(this.percentageEl_,r);this.percent_=r}for(let t=0;t<e.length;t++){const i=e.start(t);const r=e.end(t);let o=n[t];if(!o){o=this.el_.appendChild(ea());n[t]=o}if(o.dataset.start===i&&o.dataset.end===r){continue}o.dataset.start=i;o.dataset.end=r;o.style.left=lc(i,s);o.style.width=lc(r-i,s)}for(let t=n.length;t>e.length;t--){this.el_.removeChild(n[t-1])}n.length=e.length}))}}Sh.registerComponent("LoadProgressBar",dc);class pc extends Sh{constructor(t,e){super(t,e);this.update=th(Za(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(t,e,i){const s=va(this.el_);const n=ma(this.player_.el());const r=t.width*e;if(!n||!s){return}const o=t.left-n.left+r;const a=t.width-r+(n.right-t.right);let h=s.width/2;if(o<h){h+=h-o}else if(a<h){h=a}if(h<0){h=0}else if(h>s.width){h=s.width}h=Math.round(h);this.el_.style.right=`-${h}px`;this.write(i)}write(t){ia(this.el_,t)}updateTime(t,e,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let n;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const t=this.player_.liveTracker.liveWindow();const i=t-e*t;n=(i<1?"":"-")+_h(i,t)}else{n=_h(i,r)}this.update(t,e,n);if(s){s()}}))}}Sh.registerComponent("TimeTooltip",pc);class mc extends Sh{constructor(t,e){super(t,e);this.setIcon("circle");this.update=th(Za(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(t,e){const i=this.getChild("timeTooltip");if(!i){return}const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(t,e,s)}}mc.prototype.options_={children:[]};if(!Xo&&!_o){mc.prototype.options_.children.push("timeTooltip")}Sh.registerComponent("PlayProgressBar",mc);class vc extends Sh{constructor(t,e){super(t,e);this.update=th(Za(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(t,e){const i=e*this.player_.duration();this.getChild("timeTooltip").updateTime(t,e,i,(()=>{this.el_.style.left=`${t.width*e}px`}))}}vc.prototype.options_={children:["timeTooltip"]};Sh.registerComponent("MouseTimeDisplay",vc);const gc=5;const yc=12;class bc extends fc{constructor(t,e){super(t,e);this.setEventHandlers_()}setEventHandlers_(){this.update_=Za(this,this.update);this.update=th(this.update_,Ja);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.enableIntervalHandler_=t=>this.enableInterval_(t);this.disableIntervalHandler_=t=>this.disableInterval_(t);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in l&&"visibilityState"in l){this.on(l,"visibilitychange",this.toggleVisibility_)}}toggleVisibility_(t){if(l.visibilityState==="hidden"){this.cancelNamedAnimationFrame("SeekBar#update");this.cancelNamedAnimationFrame("Slider#update");this.disableInterval_(t)}else{if(!this.player_.ended()&&!this.player_.paused()){this.enableInterval_()}this.update()}}enableInterval_(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,Ja)}disableInterval_(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t&&t.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(t){if(l.visibilityState==="hidden"){return}const e=super.update();this.requestNamedAnimationFrame("SeekBar#update",(()=>{const t=this.player_.ended()?this.player_.duration():this.getCurrentTime_();const i=this.player_.liveTracker;let s=this.player_.duration();if(i&&i.isLive()){s=this.player_.liveTracker.liveCurrentTime()}if(this.percent_!==e){this.el_.setAttribute("aria-valuenow",(e*100).toFixed(2));this.percent_=e}if(this.currentTime_!==t||this.duration_!==s){this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[_h(t,s),_h(s,s)],"{1} of {2}"));this.currentTime_=t;this.duration_=s}if(this.bar){this.bar.update(ma(this.el()),this.getProgress())}}));return e}userSeek_(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(t)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const t=this.getCurrentTime_();let e;const i=this.player_.liveTracker;if(i&&i.isLive()){e=(t-i.seekableStart())/i.liveWindow();if(i.atLiveEdge()){e=1}}else{e=t/this.player_.duration()}return e}handleMouseDown(t){if(!ka(t)){return}t.stopPropagation();this.videoWasPlaying=!this.player_.paused();this.player_.pause();super.handleMouseDown(t)}handleMouseMove(t,e=false){if(!ka(t)||isNaN(this.player_.duration())){return}if(!e&&!this.player_.scrubbing()){this.player_.scrubbing(true)}let i;const s=this.calculateDistance(t);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 t=n.seekableStart();const e=n.liveCurrentTime();i=t+s*n.liveWindow();if(i>=e){i=e}if(i<=t){i=t+.1}if(i===Infinity){return}}this.userSeek_(i)}enable(){super.enable();const t=this.getChild("mouseTimeDisplay");if(!t){return}t.show()}disable(){super.disable();const t=this.getChild("mouseTimeDisplay");if(!t){return}t.hide()}handleMouseUp(t){super.handleMouseUp(t);if(t){t.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){Rh(this.player_.play())}else{this.update_()}}stepForward(){this.userSeek_(this.player_.currentTime()+gc)}stepBack(){this.userSeek_(this.player_.currentTime()-gc)}handleAction(t){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}}handleKeyDown(t){const e=this.player_.liveTracker;if(d.isEventKey(t,"Space")||d.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.handleAction(t)}else if(d.isEventKey(t,"Home")){t.preventDefault();t.stopPropagation();this.userSeek_(0)}else if(d.isEventKey(t,"End")){t.preventDefault();t.stopPropagation();if(e&&e.isLive()){this.userSeek_(e.liveCurrentTime())}else{this.userSeek_(this.player_.duration())}}else if(/^[0-9]$/.test(d(t))){t.preventDefault();t.stopPropagation();const i=(d.codes[d(t)]-d.codes["0"])*10/100;if(e&&e.isLive()){this.userSeek_(e.seekableStart()+e.liveWindow()*i)}else{this.userSeek_(this.player_.duration()*i)}}else if(d.isEventKey(t,"PgDn")){t.preventDefault();t.stopPropagation();this.userSeek_(this.player_.currentTime()-gc*yc)}else if(d.isEventKey(t,"PgUp")){t.preventDefault();t.stopPropagation();this.userSeek_(this.player_.currentTime()+gc*yc)}else{super.handleKeyDown(t)}}dispose(){this.disableInterval_();this.off(this.player_,["ended","durationchange","timeupdate"],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 l&&"visibilityState"in l){this.off(l,"visibilitychange",this.toggleVisibility_)}super.dispose()}}bc.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!Xo&&!_o){bc.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}Sh.registerComponent("SeekBar",bc);class wc extends Sh{constructor(t,e){super(t,e);this.handleMouseMove=th(Za(this,this.handleMouseMove),Ja);this.throttledHandleMouseSeek=th(Za(this,this.handleMouseSeek),Ja);this.handleMouseUpHandler_=t=>this.handleMouseUp(t);this.handleMouseDownHandler_=t=>this.handleMouseDown(t);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(t){const e=this.getChild("seekBar");if(!e){return}const i=e.getChild("playProgressBar");const s=e.getChild("mouseTimeDisplay");if(!i&&!s){return}const n=e.el();const r=va(n);let o=ga(n,t).x;o=uc(o,0,1);if(s){s.update(r,o)}if(i){i.update(r,e.getProgress())}}handleMouseSeek(t){const e=this.getChild("seekBar");if(e){e.handleMouseMove(t)}}enabled(){return this.enabled_}disable(){this.children().forEach((t=>t.disable&&t.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 t=this.getChild("seekBar");this.player_.scrubbing(false);if(t.videoWasPlaying){Rh(this.player_.play())}}}enable(){this.children().forEach((t=>t.enable&&t.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 t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseSeek);this.off(t,"touchmove",this.throttledHandleMouseSeek);this.off(t,"mouseup",this.handleMouseUpHandler_);this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseDown(t){const e=this.el_.ownerDocument;const i=this.getChild("seekBar");if(i){i.handleMouseDown(t)}this.on(e,"mousemove",this.throttledHandleMouseSeek);this.on(e,"touchmove",this.throttledHandleMouseSeek);this.on(e,"mouseup",this.handleMouseUpHandler_);this.on(e,"touchend",this.handleMouseUpHandler_)}handleMouseUp(t){const e=this.getChild("seekBar");if(e){e.handleMouseUp(t)}this.removeListenersAddedOnMousedownAndTouchstart()}}wc.prototype.options_={children:["seekBar"]};Sh.registerComponent("ProgressControl",wc);class Tc extends Ju{constructor(t,e){super(t,e);this.setIcon("picture-in-picture-enter");this.on(t,["enterpictureinpicture","leavepictureinpicture"],(t=>this.handlePictureInPictureChange(t)));this.on(t,["disablepictureinpicturechanged","loadedmetadata"],(t=>this.handlePictureInPictureEnabledChange(t)));this.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange()));this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){const t=this.player_.currentType().substring(0,5)==="audio";const e=t||this.player_.audioPosterMode()||this.player_.audioOnlyMode();if(!e){this.show();return}if(this.player_.isInPictureInPicture()){this.player_.exitPictureInPicture()}this.hide()}handlePictureInPictureEnabledChange(){if(l.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===false||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in o){this.enable()}else{this.disable()}}handlePictureInPictureChange(t){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(t){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}}show(){if(typeof l.exitPictureInPicture!=="function"){return}super.show()}}Tc.prototype.controlText_="Picture-in-Picture";Sh.registerComponent("PictureInPictureToggle",Tc);class Sc extends Ju{constructor(t,e){super(t,e);this.setIcon("fullscreen-enter");this.on(t,"fullscreenchange",(t=>this.handleFullscreenChange(t)));if(l[t.fsApi_.fullscreenEnabled]===false){this.disable()}}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(t){if(this.player_.isFullscreen()){this.controlText("Exit Fullscreen");this.setIcon("fullscreen-exit")}else{this.controlText("Fullscreen");this.setIcon("fullscreen-enter")}}handleClick(t){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}}}Sc.prototype.controlText_="Fullscreen";Sh.registerComponent("FullscreenToggle",Sc);const kc=function(t,e){if(e.tech_&&!e.tech_.featuresVolumeControl){t.addClass("vjs-hidden")}t.on(e,"loadstart",(function(){if(!e.tech_.featuresVolumeControl){t.addClass("vjs-hidden")}else{t.removeClass("vjs-hidden")}}))};class Ec extends Sh{createEl(){const t=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",t);t.appendChild(super.createEl("span",{className:"vjs-control-text"}));return t}}Sh.registerComponent("VolumeLevel",Ec);class Ic extends Sh{constructor(t,e){super(t,e);this.update=th(Za(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(t,e,i,s){if(!i){const i=ma(this.el_);const s=ma(this.player_.el());const n=t.width*e;if(!s||!i){return}const r=t.left-s.left+n;const o=t.width-n+(s.right-t.right);let a=i.width/2;if(r<a){a+=a-r}else if(o<a){a=o}if(a<0){a=0}else if(a>i.width){a=i.width}this.el_.style.right=`-${a}px`}this.write(`${s}%`)}write(t){ia(this.el_,t)}updateVolume(t,e,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(t,e,i,s.toFixed(0));if(n){n()}}))}}Sh.registerComponent("VolumeLevelTooltip",Ic);class xc extends Sh{constructor(t,e){super(t,e);this.update=th(Za(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(t,e,i){const s=100*e;this.getChild("volumeLevelTooltip").updateVolume(t,e,i,s,(()=>{if(i){this.el_.style.bottom=`${t.height*e}px`}else{this.el_.style.left=`${t.width*e}px`}}))}}xc.prototype.options_={children:["volumeLevelTooltip"]};Sh.registerComponent("MouseVolumeLevelDisplay",xc);class Ac extends fc{constructor(t,e){super(t,e);this.on("slideractive",(t=>this.updateLastVolume_(t)));this.on(t,"volumechange",(t=>this.updateARIAAttributes(t)));t.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(t){if(!ka(t)){return}super.handleMouseDown(t)}handleMouseMove(t){const e=this.getChild("mouseVolumeLevelDisplay");if(e){const i=this.el();const s=ma(i);const n=this.vertical();let r=ga(i,t);r=n?r.y:r.x;r=uc(r,0,1);e.update(s,r,n)}if(!ka(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(t){const e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e);this.el_.setAttribute("aria-valuetext",e+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const t=this.player_.volume();this.one("sliderinactive",(()=>{if(this.player_.volume()===0){this.player_.lastVolume_(t)}}))}}Ac.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!Xo&&!_o){Ac.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay")}Ac.prototype.playerEvent="volumechange";Sh.registerComponent("VolumeBar",Ac);class Dc extends Sh{constructor(t,e={}){e.vertical=e.vertical||false;if(typeof e.volumeBar==="undefined"||Eo(e.volumeBar)){e.volumeBar=e.volumeBar||{};e.volumeBar.vertical=e.vertical}super(t,e);kc(this,t);this.throttledHandleMouseMove=th(Za(this,this.handleMouseMove),Ja);this.handleMouseUpHandler_=t=>this.handleMouseUp(t);this.on("mousedown",(t=>this.handleMouseDown(t)));this.on("touchstart",(t=>this.handleMouseDown(t)));this.on("mousemove",(t=>this.handleMouseMove(t)));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 t="vjs-volume-horizontal";if(this.options_.vertical){t="vjs-volume-vertical"}return super.createEl("div",{className:`vjs-volume-control vjs-control ${t}`})}handleMouseDown(t){const e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove);this.on(e,"touchmove",this.throttledHandleMouseMove);this.on(e,"mouseup",this.handleMouseUpHandler_);this.on(e,"touchend",this.handleMouseUpHandler_)}handleMouseUp(t){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove);this.off(e,"touchmove",this.throttledHandleMouseMove);this.off(e,"mouseup",this.handleMouseUpHandler_);this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseMove(t){this.volumeBar.handleMouseMove(t)}}Dc.prototype.options_={children:["volumeBar"]};Sh.registerComponent("VolumeControl",Dc);const Cc=function(t,e){if(e.tech_&&!e.tech_.featuresMuteControl){t.addClass("vjs-hidden")}t.on(e,"loadstart",(function(){if(!e.tech_.featuresMuteControl){t.addClass("vjs-hidden")}else{t.removeClass("vjs-hidden")}}))};class jc extends Ju{constructor(t,e){super(t,e);Cc(this,t);this.on(t,["loadstart","volumechange"],(t=>this.update(t)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(t){const e=this.player_.volume();const i=this.player_.lastVolume_();if(e===0){const t=i<.1?.1:i;this.player_.volume(t);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}}update(t){this.updateIcon_();this.updateControlText_()}updateIcon_(){const t=this.player_.volume();let e=3;this.setIcon("volume-high");if(Xo&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(t===0||this.player_.muted()){this.setIcon("volume-mute");e=0}else if(t<.33){this.setIcon("volume-low");e=1}else if(t<.67){this.setIcon("volume-medium");e=2}oa(this.el_,[0,1,2,3].reduce(((t,e)=>t+`${e?" ":""}vjs-vol-${e}`),""));ra(this.el_,`vjs-vol-${e}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0;const e=t?"Unmute":"Mute";if(this.controlText()!==e){this.controlText(e)}}}jc.prototype.controlText_="Mute";Sh.registerComponent("MuteToggle",jc);class _c extends Sh{constructor(t,e={}){if(typeof e.inline!=="undefined"){e.inline=e.inline}else{e.inline=true}if(typeof e.volumeControl==="undefined"||Eo(e.volumeControl)){e.volumeControl=e.volumeControl||{};e.volumeControl.vertical=!e.inline}super(t,e);this.handleKeyPressHandler_=t=>this.handleKeyPress(t);this.on(t,["loadstart"],(t=>this.volumePanelState_(t)));this.on(this.muteToggle,"keyup",(t=>this.handleKeyPress(t)));this.on(this.volumeControl,"keyup",(t=>this.handleVolumeControlKeyUp(t)));this.on("keydown",(t=>this.handleKeyPress(t)));this.on("mouseover",(t=>this.handleMouseOver(t)));this.on("mouseout",(t=>this.handleMouseOut(t)));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 t="vjs-volume-panel-horizontal";if(!this.options_.inline){t="vjs-volume-panel-vertical"}return super.createEl("div",{className:`vjs-volume-panel vjs-control ${t}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(t){if(d.isEventKey(t,"Esc")){this.muteToggle.focus()}}handleMouseOver(t){this.addClass("vjs-hover");Xa(l,"keyup",this.handleKeyPressHandler_)}handleMouseOut(t){this.removeClass("vjs-hover");Ga(l,"keyup",this.handleKeyPressHandler_)}handleKeyPress(t){if(d.isEventKey(t,"Esc")){this.handleMouseOut()}}}_c.prototype.options_={children:["muteToggle","volumeControl"]};Sh.registerComponent("VolumePanel",_c);class Nc extends Ju{constructor(t,e){super(t,e);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]));this.show()}else{this.hide()}}getSkipForwardTime(){const t=this.options_.playerOptions;return t.controlBar&&t.controlBar.skipButtons&&t.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(t){if(isNaN(this.player_.duration())){return}const e=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;if(e+this.skipTime<=s){n=e+this.skipTime}else{n=s}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Sh.registerComponent("SkipForward",Nc);class Mc extends Ju{constructor(t,e){super(t,e);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]));this.show()}else{this.hide()}}getSkipBackwardTime(){const t=this.options_.playerOptions;return t.controlBar&&t.controlBar.skipButtons&&t.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(t){const e=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()&&i.seekableStart();let n;if(s&&e-this.skipTime<=s){n=s}else if(e>=this.skipTime){n=e-this.skipTime}else{n=0}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Mc.prototype.controlText_="Skip Backward";Sh.registerComponent("SkipBackward",Mc);class Oc extends Sh{constructor(t,e){super(t,e);if(e){this.menuButton_=e.menuButton}this.focusedChild_=-1;this.on("keydown",(t=>this.handleKeyDown(t)));this.boundHandleBlur_=t=>this.handleBlur(t);this.boundHandleTapClick_=t=>this.handleTapClick(t)}addEventListenerForItem(t){if(!(t instanceof Sh)){return}this.on(t,"blur",this.boundHandleBlur_);this.on(t,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(t){if(!(t instanceof Sh)){return}this.off(t,"blur",this.boundHandleBlur_);this.off(t,["tap","click"],this.boundHandleTapClick_)}removeChild(t){if(typeof t==="string"){t=this.getChild(t)}this.removeEventListenerForItem(t);super.removeChild(t)}addItem(t){const e=this.addChild(t);if(e){this.addEventListenerForItem(e)}}createEl(){const t=this.options_.contentElType||"ul";this.contentEl_=ea(t,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const e=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});e.appendChild(this.contentEl_);Xa(e,"click",(function(t){t.preventDefault();t.stopImmediatePropagation()}));return e}dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;super.dispose()}handleBlur(t){const e=t.relatedTarget||l.activeElement;if(!this.children().some((t=>t.el()===e))){const t=this.menuButton_;if(t&&t.buttonPressed_&&e!==t.el().firstChild){t.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(t){if(d.isEventKey(t,"Left")||d.isEventKey(t,"Down")){t.preventDefault();t.stopPropagation();this.stepForward()}else if(d.isEventKey(t,"Right")||d.isEventKey(t,"Up")){t.preventDefault();t.stopPropagation();this.stepBack()}}stepForward(){let t=0;if(this.focusedChild_!==undefined){t=this.focusedChild_+1}this.focus(t)}stepBack(){let t=0;if(this.focusedChild_!==undefined){t=this.focusedChild_-1}this.focus(t)}focus(t=0){const e=this.children().slice();const i=e.length&&e[0].hasClass("vjs-menu-title");if(i){e.shift()}if(e.length>0){if(t<0){t=0}else if(t>=e.length){t=e.length-1}this.focusedChild_=t;e[t].el_.focus()}}}Sh.registerComponent("Menu",Oc);class Lc extends Sh{constructor(t,e={}){super(t,e);this.menuButton_=new Ju(t,e);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Ju.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=t=>this.handleClick(t);this.handleMenuKeyUp_=t=>this.handleMenuKeyUp(t);this.on(this.menuButton_,"tap",s);this.on(this.menuButton_,"click",s);this.on(this.menuButton_,"keydown",(t=>this.handleKeyDown(t)));this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover");this.menu.show();Xa(l,"keyup",this.handleMenuKeyUp_)}));this.on("mouseleave",(t=>this.handleMouseLeave(t)));this.on("keydown",(t=>this.handleSubmenuKeyDown(t)))}update(){const t=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=t;this.addChild(t);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 Oc(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){const e=ea("li",{className:"vjs-menu-title",textContent:bh(this.options_.title),tabIndex:-1});const i=new Sh(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(t){super.setIcon(t,this.menuButton_.el_)}buildWrapperCSSClass(){let t="vjs-menu-button";if(this.options_.inline===true){t+="-inline"}else{t+="-popup"}const e=Ju.prototype.buildCSSClass();return`vjs-menu-button ${t} ${e} ${super.buildCSSClass()}`}buildCSSClass(){let t="vjs-menu-button";if(this.options_.inline===true){t+="-inline"}else{t+="-popup"}return`vjs-menu-button ${t} ${super.buildCSSClass()}`}controlText(t,e=this.menuButton_.el()){return this.menuButton_.controlText(t,e)}dispose(){this.handleMouseLeave();super.dispose()}handleClick(t){if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}}handleMouseLeave(t){this.removeClass("vjs-hover");Ga(l,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(t){if(d.isEventKey(t,"Esc")||d.isEventKey(t,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!d.isEventKey(t,"Tab")){t.preventDefault();this.menuButton_.focus()}}else if(d.isEventKey(t,"Up")||d.isEventKey(t,"Down")){if(!this.buttonPressed_){t.preventDefault();this.pressButton()}}}handleMenuKeyUp(t){if(d.isEventKey(t,"Esc")||d.isEventKey(t,"Tab")){this.removeClass("vjs-hover")}}handleSubmenuKeyPress(t){this.handleSubmenuKeyDown(t)}handleSubmenuKeyDown(t){if(d.isEventKey(t,"Esc")||d.isEventKey(t,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!d.isEventKey(t,"Tab")){t.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(Xo&&Zo()){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()}}Sh.registerComponent("MenuButton",Lc);class Rc extends Lc{constructor(t,e){const i=e.tracks;super(t,e);if(this.items.length<=1){this.hide()}if(!i){return}const s=Za(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)}))}}Sh.registerComponent("TrackButton",Rc);const $c=["Tab","Esc","Up","Down","Right","Left"];class Pc extends qu{constructor(t,e){super(t,e);this.selectable=e.selectable;this.isSelected_=e.selected||false;this.multiSelectable=e.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(t,e,i){this.nonIconControl=true;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},e),i);const n=ea("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(t){if(!$c.some((e=>d.isEventKey(t,e)))){super.handleKeyDown(t)}}handleClick(t){this.selected(true)}selected(t){if(this.selectable){if(t){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}}}}Sh.registerComponent("MenuItem",Pc);class Uc extends Pc{constructor(t,e){const i=e.track;const s=t.textTracks();e.label=i.label||i.language||"Unknown";e.selected=i.mode==="showing";super(t,e);this.track=i;this.kinds=(e.kinds||[e.kind||this.track.kind]).filter(Boolean);const n=(...t)=>{this.handleTracksChange.apply(this,t)};const r=(...t)=>{this.handleSelectedLanguageChange.apply(this,t)};t.on(["loadstart","texttrackchange"],n);s.addEventListener("change",n);s.addEventListener("selectedlanguagechange",r);this.on("dispose",(function(){t.off(["loadstart","texttrackchange"],n);s.removeEventListener("change",n);s.removeEventListener("selectedlanguagechange",r)}));if(s.onchange===undefined){let t;this.on(["tap","click"],(function(){if(typeof o.Event!=="object"){try{t=new o.Event("change")}catch(t){}}if(!t){t=l.createEvent("Event");t.initEvent("change",true,true)}s.dispatchEvent(t)}))}this.handleTracksChange()}handleClick(t){const e=this.track;const i=this.player_.textTracks();super.handleClick(t);if(!i){return}for(let t=0;t<i.length;t++){const s=i[t];if(this.kinds.indexOf(s.kind)===-1){continue}if(s===e){if(s.mode!=="showing"){s.mode="showing"}}else if(s.mode!=="disabled"){s.mode="disabled"}}}handleTracksChange(t){const e=this.track.mode==="showing";if(e!==this.isSelected_){this.selected(e)}}handleSelectedLanguageChange(t){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()}}Sh.registerComponent("TextTrackMenuItem",Uc);class Fc extends Uc{constructor(t,e){e.track={player:t,kind:e.kind,kinds:e.kinds,default:false,mode:"disabled"};if(!e.kinds){e.kinds=[e.kind]}if(e.label){e.track.label=e.label}else{e.track.label=e.kinds.join(" and ")+" off"}e.selectable=true;e.multiSelectable=false;super(t,e)}handleTracksChange(t){const e=this.player().textTracks();let i=true;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(this.options_.kinds.indexOf(s.kind)>-1&&s.mode==="showing"){i=false;break}}if(i!==this.isSelected_){this.selected(i)}}handleSelectedLanguageChange(t){const e=this.player().textTracks();let i=true;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&s.mode==="showing"){i=false;break}}if(i){this.player_.cache_.selectedLanguage={enabled:false}}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}}Sh.registerComponent("OffTextTrackMenuItem",Fc);class Bc extends Rc{constructor(t,e={}){e.tracks=t.textTracks();super(t,e)}createItems(t=[],e=Uc){let i;if(this.label_){i=`${this.label_} off`}t.push(new Fc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i}));this.hideThreshold_+=1;const s=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(let i=0;i<s.length;i++){const n=s[i];if(this.kinds_.indexOf(n.kind)>-1){const i=new e(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});i.addClass(`vjs-${n.kind}-menu-item`);t.push(i)}}return t}}Sh.registerComponent("TextTrackButton",Bc);class qc extends Pc{constructor(t,e){const i=e.track;const s=e.cue;const n=t.currentTime();e.selectable=true;e.multiSelectable=false;e.label=s.text;e.selected=s.startTime<=n&&n<s.endTime;super(t,e);this.track=i;this.cue=s}handleClick(t){super.handleClick();this.player_.currentTime(this.cue.startTime)}}Sh.registerComponent("ChaptersTrackMenuItem",qc);class Vc extends Bc{constructor(t,e,i){super(t,e,i);this.setIcon("chapters");this.selectCurrentItem_=()=>{this.items.forEach((t=>{t.selected(this.track_.activeCues[0]===t.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(t){if(t&&t.track&&t.track.kind!=="chapters"){return}const e=this.findChaptersTrack();if(e!==this.track_){this.setTrack(e);super.update()}else if(!this.items||e&&e.cues&&e.cues.length!==this.items.length){super.update()}}setTrack(t){if(this.track_===t){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_=t;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(bh(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const t=[];if(!this.track_){return t}const e=this.track_.cues;if(!e){return t}for(let i=0,s=e.length;i<s;i++){const s=e[i];const n=new qc(this.player_,{track:this.track_,cue:s});t.push(n)}return t}}Vc.prototype.kind_="chapters";Vc.prototype.controlText_="Chapters";Sh.registerComponent("ChaptersButton",Vc);class Hc extends Bc{constructor(t,e,i){super(t,e,i);this.setIcon("audio-description");const s=t.textTracks();const n=Za(this,this.handleTracksChange);s.addEventListener("change",n);this.on("dispose",(function(){s.removeEventListener("change",n)}))}handleTracksChange(t){const e=this.player().textTracks();let i=false;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(s.kind!==this.kind_&&s.mode==="showing"){i=true;break}}if(i){this.disable()}else{this.enable()}}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Hc.prototype.kind_="descriptions";Hc.prototype.controlText_="Descriptions";Sh.registerComponent("DescriptionsButton",Hc);class zc extends Bc{constructor(t,e,i){super(t,e,i);this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}zc.prototype.kind_="subtitles";zc.prototype.controlText_="Subtitles";Sh.registerComponent("SubtitlesButton",zc);class Xc extends Uc{constructor(t,e){e.track={player:t,kind:e.kind,label:e.kind+" settings",selectable:false,default:false,mode:"disabled"};e.selectable=false;e.name="CaptionSettingsMenuItem";super(t,e);this.addClass("vjs-texttrack-settings");this.controlText(", opens "+e.kind+" settings dialog")}handleClick(t){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings");super.handleLanguagechange()}}Sh.registerComponent("CaptionSettingsMenuItem",Xc);class Gc extends Bc{constructor(t,e,i){super(t,e,i);this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new Xc(this.player_,{kind:this.kind_}));this.hideThreshold_+=1}return super.createItems(t)}}Gc.prototype.kind_="captions";Gc.prototype.controlText_="Captions";Sh.registerComponent("CaptionsButton",Gc);class Wc extends Uc{createEl(t,e,i){const s=super.createEl(t,e,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(ea("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}n.appendChild(ea("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))}return s}}Sh.registerComponent("SubsCapsMenuItem",Wc);class Yc extends Bc{constructor(t,e={}){super(t,e);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(bh(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new Xc(this.player_,{kind:this.label_}));this.hideThreshold_+=1}t=super.createItems(t,Wc);return t}}Yc.prototype.kinds_=["captions","subtitles"];Yc.prototype.controlText_="Subtitles";Sh.registerComponent("SubsCapsButton",Yc);class Kc extends Pc{constructor(t,e){const i=e.track;const s=t.audioTracks();e.label=i.label||i.language||"Unknown";e.selected=i.enabled;super(t,e);this.track=i;this.addClass(`vjs-${i.kind}-menu-item`);const n=(...t)=>{this.handleTracksChange.apply(this,t)};s.addEventListener("change",n);this.on("dispose",(()=>{s.removeEventListener("change",n)}))}createEl(t,e,i){const s=super.createEl(t,e,i);const n=s.querySelector(".vjs-menu-item-text");if(["main-desc","description"].indexOf(this.options_.track.kind)>=0){n.appendChild(ea("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));n.appendChild(ea("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))}return s}handleClick(t){super.handleClick(t);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(t){this.selected(this.track.enabled)}}Sh.registerComponent("AudioTrackMenuItem",Kc);class Qc extends Rc{constructor(t,e={}){e.tracks=t.audioTracks();super(t,e);this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(t=[]){this.hideThreshold_=1;const e=this.player_.audioTracks();for(let i=0;i<e.length;i++){const s=e[i];t.push(new Kc(this.player_,{track:s,selectable:true,multiSelectable:false}))}return t}}Qc.prototype.controlText_="Audio Track";Sh.registerComponent("AudioTrackButton",Qc);class Jc extends Pc{constructor(t,e){const i=e.rate;const s=parseFloat(i,10);e.label=i;e.selected=s===t.playbackRate();e.selectable=true;e.multiSelectable=false;super(t,e);this.label=i;this.rate=s;this.on(t,"ratechange",(t=>this.update(t)))}handleClick(t){super.handleClick();this.player().playbackRate(this.rate)}update(t){this.selected(this.player().playbackRate()===this.rate)}}Jc.prototype.contentElType="button";Sh.registerComponent("PlaybackRateMenuItem",Jc);class Zc extends Lc{constructor(t,e){super(t,e);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(t,"loadstart",(t=>this.updateVisibility(t)));this.on(t,"ratechange",(t=>this.updateLabel(t)));this.on(t,"playbackrateschange",(t=>this.handlePlaybackRateschange(t)))}createEl(){const t=super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=ea("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});t.appendChild(this.labelEl_);return t}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 e=[];for(let i=t.length-1;i>=0;i--){e.push(new Jc(this.player(),{rate:t[i]+"x"}))}return e}handlePlaybackRateschange(t){this.update()}playbackRates(){const t=this.player();return t.playbackRates&&t.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(t){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}}updateLabel(t){if(this.playbackRateSupported()){this.labelEl_.textContent=this.player().playbackRate()+"x"}}}Zc.prototype.controlText_="Playback Rate";Sh.registerComponent("PlaybackRateMenuButton",Zc);class tf extends Sh{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(t="div",e={},i={}){if(!e.className){e.className=this.buildCSSClass()}return super.createEl(t,e,i)}}Sh.registerComponent("Spacer",tf);class ef extends tf{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Sh.registerComponent("CustomControlSpacer",ef);class sf extends Sh{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}sf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};Sh.registerComponent("ControlBar",sf);class nf extends qh{constructor(t,e){super(t,e);this.on(t,"error",(t=>this.open(t)))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const t=this.player().error();return t?this.localize(t.message):""}}nf.prototype.options_=Object.assign({},qh.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});Sh.registerComponent("ErrorDisplay",nf);const rf="vjs-text-track-settings";const of=["#000","Black"];const af=["#00F","Blue"];const hf=["#0FF","Cyan"];const uf=["#0F0","Green"];const cf=["#F0F","Magenta"];const ff=["#F00","Red"];const lf=["#FFF","White"];const df=["#FF0","Yellow"];const pf=["1","Opaque"];const mf=["0.5","Semi-Transparent"];const vf=["0","Transparent"];const gf={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[of,lf,ff,uf,af,df,cf,hf]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[pf,mf,vf]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[lf,of,ff,uf,af,df,cf,hf]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:t=>t==="1.00"?null:Number(t)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[pf,mf]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[vf,mf,pf]}};gf.windowColor.options=gf.backgroundColor.options;function yf(t,e){if(e){t=e(t)}if(t&&t!=="none"){return t}}function bf(t,e){const i=t.options[t.options.selectedIndex].value;return yf(i,e)}function wf(t,e,i){if(!e){return}for(let s=0;s<t.options.length;s++){if(yf(t.options[s].value,i)===e){t.selectedIndex=s;break}}}class Tf extends qh{constructor(t,e){e.temporary=false;super(t,e);this.updateDisplay=this.updateDisplay.bind(this);this.fill();this.hasBeenOpened_=this.hasBeenFilled_=true;this.endDialog=ea("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")});this.el().appendChild(this.endDialog);this.setDefaults();if(e.persistTextTrackSettings===undefined){this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings}this.on(this.$(".vjs-done-button"),"click",(()=>{this.saveSettings();this.close()}));this.on(this.$(".vjs-default-button"),"click",(()=>{this.setDefaults();this.updateDisplay()}));To(gf,(t=>{this.on(this.$(t.selector),"change",this.updateDisplay)}));if(this.options_.persistTextTrackSettings){this.restoreSettings()}}dispose(){this.endDialog=null;super.dispose()}createElSelect_(t,e="",i="label"){const s=gf[t];const n=s.id.replace("%s",this.id_);const r=[e,n].join(" ").trim();return[`<${i} id="${n}" class="${i==="label"?"vjs-label":""}">`,this.localize(s.label),`</${i}>`,`<select aria-labelledby="${r}">`].concat(s.options.map((t=>{const e=n+"-"+t[1].replace(/\W+/g,"");return[`<option id="${e}" value="${t[0]}" `,`aria-labelledby="${r} ${e}">`,this.localize(t[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){const t=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${t}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",t),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")}createElBgColor_(){const t=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${t}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",t),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")}createElWinColor_(){const t=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${t}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",t),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")}createElColors_(){return ea("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return ea("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const t=this.localize("restore all settings to the default values");return ea("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${t}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${t}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}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 So(gf,((t,e,i)=>{const s=bf(this.$(e.selector),e.parser);if(s!==undefined){t[i]=s}return t}),{})}setValues(t){To(gf,((e,i)=>{wf(this.$(e.selector),t[i],e.parser)}))}setDefaults(){To(gf,(t=>{const e=t.hasOwnProperty("default")?t.default:0;this.$(t.selector).selectedIndex=e}))}restoreSettings(){let t;try{t=JSON.parse(o.localStorage.getItem(rf))}catch(t){go.warn(t)}if(t){this.setValues(t)}}saveSettings(){if(!this.options_.persistTextTrackSettings){return}const t=this.getValues();try{if(Object.keys(t).length){o.localStorage.setItem(rf,JSON.stringify(t))}else{o.localStorage.removeItem(rf)}}catch(t){go.warn(t)}}updateDisplay(){const t=this.player_.getChild("textTrackDisplay");if(t){t.updateDisplay()}}conditionalBlur_(){this.previouslyActiveEl_=null;const t=this.player_.controlBar;const e=t&&t.subsCapsButton;const i=t&&t.captionsButton;if(e){e.focus()}else if(i){i.focus()}}handleLanguagechange(){this.fill()}}Sh.registerComponent("TextTrackSettings",Tf);class Sf extends Sh{constructor(t,e){let i=e.ResizeObserver||o.ResizeObserver;if(e.ResizeObserver===null){i=false}const s=Io({createEl:!i,reportTouchActivity:false},e);super(t,s);this.ResizeObserver=e.ResizeObserver||o.ResizeObserver;this.loadListener_=null;this.resizeObserver_=null;this.debouncedHandler_=eh((()=>{this.resizeHandler()}),100,false,this);if(i){this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_);this.resizeObserver_.observe(t.el())}else{this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow){return}const t=this.debouncedHandler_;let e=this.unloadListener_=function(){Ga(this,"resize",t);Ga(this,"unload",e);e=null};Xa(this.el_.contentWindow,"unload",e);Xa(this.el_.contentWindow,"resize",t)};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()}}Sh.registerComponent("ResizeManager",Sf);const kf={trackingThreshold:20,liveTolerance:15};class Ef extends Sh{constructor(t,e){const i=Io(kf,e,{createEl:false});super(t,i);this.trackLiveHandler_=()=>this.trackLive_();this.handlePlay_=t=>this.handlePlay(t);this.handleFirstTimeupdate_=t=>this.handleFirstTimeupdate(t);this.handleSeeked_=t=>this.handleSeeked(t);this.seekToLiveEdge_=t=>this.seekToLiveEdge(t);this.reset_();this.on(this.player_,"durationchange",(t=>this.handleDurationchange(t)));this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const t=this.player_.seekable();if(!t||!t.length){return}const e=Number(o.performance.now().toFixed(4));const i=this.lastTime_===-1?0:(e-this.lastTime_)/1e3;this.lastTime_=e;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_,Ja);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 t=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&t>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 t=this.player_.seekable();const e=[];let i=t?t.length:0;while(i--){e.push(t.end(i))}return e.length?e.sort()[e.length-1]:Infinity}seekableStart(){const t=this.player_.seekable();const e=[];let i=t?t.length:0;while(i--){e.push(t.start(i))}return e.length?e.sort()[0]:0}liveWindow(){const t=this.liveCurrentTime();if(t===Infinity){return 0}return t-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const t=this.seekableEnd();if(this.lastSeekEnd_!==-1&&t!==this.lastSeekEnd_){this.pastSeekEnd_=0}this.lastSeekEnd_=t;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()}}Sh.registerComponent("LiveTracker",Ef);class If extends Sh{constructor(t,e){super(t,e);this.on("statechanged",(t=>this.updateDom_()));this.updateDom_()}createEl(){this.els={title:ea("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Ua()}`}),description:ea("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Ua()}`})};return ea("div",{className:"vjs-title-bar"},{},xo(this.els))}updateDom_(){const t=this.player_.tech_;const e=t&&t.el_;const i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((t=>{const s=this.state[t];const n=this.els[t];const r=i[t];ba(n);if(s){ia(n,s)}if(e){e.removeAttribute(r);if(s){e.setAttribute(r,n.id)}}}));if(this.state.title||this.state.description){this.show()}else{this.hide()}}update(t){this.setState(t)}dispose(){const t=this.player_.tech_;const e=t&&t.el_;if(e){e.removeAttribute("aria-labelledby");e.removeAttribute("aria-describedby")}super.dispose();this.els=null}}Sh.registerComponent("TitleBar",If);const xf=t=>{const e=t.el();if(e.hasAttribute("src")){t.triggerSourceset(e.src);return true}const i=t.$$("source");const s=[];let n="";if(!i.length){return false}for(let t=0;t<i.length;t++){const e=i[t].src;if(e&&s.indexOf(e)===-1){s.push(e)}}if(!s.length){return false}if(s.length===1){n=s[0]}t.triggerSourceset(n);return true};const Af=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(true).innerHTML},set(t){const e=l.createElement(this.nodeName.toLowerCase());e.innerHTML=t;const i=l.createDocumentFragment();while(e.childNodes.length){i.appendChild(e.childNodes[0])}this.innerText="";o.Element.prototype.appendChild.call(this,i);return this.innerHTML}});const Df=(t,e)=>{let i={};for(let s=0;s<t.length;s++){i=Object.getOwnPropertyDescriptor(t[s],e);if(i&&i.set&&i.get){break}}i.enumerable=true;i.configurable=true;return i};const Cf=t=>Df([t.el(),o.HTMLMediaElement.prototype,o.Element.prototype,Af],"innerHTML");const jf=function(t){const e=t.el();if(e.resetSourceWatch_){return}const i={};const s=Cf(t);const n=i=>(...s)=>{const n=i.apply(e,s);xf(t);return n};["append","appendChild","insertAdjacentHTML"].forEach((t=>{if(!e[t]){return}i[t]=e[t];e[t]=n(i[t])}));Object.defineProperty(e,"innerHTML",Io(s,{set:n(s.set)}));e.resetSourceWatch_=()=>{e.resetSourceWatch_=null;Object.keys(i).forEach((t=>{e[t]=i[t]}));Object.defineProperty(e,"innerHTML",s)};t.one("sourceset",e.resetSourceWatch_)};const _f=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src")){return su(o.Element.prototype.getAttribute.call(this,"src"))}return""},set(t){o.Element.prototype.setAttribute.call(this,"src",t);return t}});const Nf=t=>Df([t.el(),o.HTMLMediaElement.prototype,_f],"src");const Mf=function(t){if(!t.featuresSourceset){return}const e=t.el();if(e.resetSourceset_){return}const i=Nf(t);const s=e.setAttribute;const n=e.load;Object.defineProperty(e,"src",Io(i,{set:s=>{const n=i.set.call(e,s);t.triggerSourceset(e.src);return n}}));e.setAttribute=(i,n)=>{const r=s.call(e,i,n);if(/src/i.test(i)){t.triggerSourceset(e.src)}return r};e.load=()=>{const i=n.call(e);if(!xf(t)){t.triggerSourceset("");jf(t)}return i};if(e.currentSrc){t.triggerSourceset(e.currentSrc)}else if(!xf(t)){jf(t)}e.resetSourceset_=()=>{e.resetSourceset_=null;e.load=n;e.setAttribute=s;Object.defineProperty(e,"src",i);if(e.resetSourceWatch_){e.resetSourceWatch_()}}};class Of extends gu{constructor(t,e){super(t,e);const i=t.source;let s=false;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO";if(i&&(this.el_.currentSrc!==i.src||t.tag&&t.tag.initNetworkState_===3)){this.setSource(i)}else{this.handleLateInit_(this.el_)}if(t.enableSourceset){this.setupSourcesetHandling_()}this.isScrubbing_=false;if(this.el_.hasChildNodes()){const t=this.el_.childNodes;let e=t.length;const i=[];while(e--){const n=t[e];const r=n.nodeName.toLowerCase();if(r==="track"){if(!this.featuresNativeTextTracks){i.push(n)}else{this.remoteTextTrackEls().addTrackElement_(n);this.remoteTextTracks().addTrack(n.track);this.textTracks().addTrack(n.track);if(!s&&!this.el_.hasAttribute("crossorigin")&&ru(n.src)){s=true}}}}for(let t=0;t<i.length;t++){this.el_.removeChild(i[t])}}this.proxyNativeTracks_();if(this.featuresNativeTextTracks&&s){go.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((Ho||Vo)&&t.nativeControlsForTouch===true){this.setControls(true)}this.proxyWebkitFullscreen_();this.triggerReady()}dispose(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_()}Of.disposeMediaElement(this.el_);this.options_=null;super.dispose()}setupSourcesetHandling_(){Mf(this)}restoreMetadataTracksInIOSNativePlayer_(){const t=this.textTracks();let e;const i=()=>{e=[];for(let i=0;i<t.length;i++){const s=t[i];if(s.kind==="metadata"){e.push({track:s,storedMode:s.mode})}}};i();t.addEventListener("change",i);this.on("dispose",(()=>t.removeEventListener("change",i)));const s=()=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.track.mode==="disabled"&&i.track.mode!==i.storedMode){i.track.mode=i.storedMode}}t.removeEventListener("change",s)};this.on("webkitbeginfullscreen",(()=>{t.removeEventListener("change",i);t.removeEventListener("change",s);t.addEventListener("change",s)}));this.on("webkitendfullscreen",(()=>{t.removeEventListener("change",i);t.addEventListener("change",i);t.removeEventListener("change",s)}))}overrideNative_(t,e){if(e!==this[`featuresNative${t}Tracks`]){return}const i=t.toLowerCase();if(this[`${i}TracksListeners_`]){Object.keys(this[`${i}TracksListeners_`]).forEach((t=>{const e=this.el()[`${i}Tracks`];e.removeEventListener(t,this[`${i}TracksListeners_`][t])}))}this[`featuresNative${t}Tracks`]=!e;this[`${i}TracksListeners_`]=null;this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(t){this.overrideNative_("Audio",t)}overrideNativeVideoTracks(t){this.overrideNative_("Video",t)}proxyNativeTracksForType_(t){const e=du[t];const i=this.el()[e.getterName];const s=this[e.getterName]();if(!this[`featuresNative${e.capitalName}Tracks`]||!i||!i.addEventListener){return}const n={change:e=>{const i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i);if(t==="text"){this[pu.remoteText.getterName]().trigger(i)}},addtrack(t){s.addTrack(t.track)},removetrack(t){s.removeTrack(t.track)}};const r=function(){const t=[];for(let e=0;e<s.length;e++){let n=false;for(let t=0;t<i.length;t++){if(i[t]===s[e]){n=true;break}}if(!n){t.push(s[e])}}while(t.length){s.removeTrack(t.shift())}};this[e.getterName+"Listeners_"]=n;Object.keys(n).forEach((t=>{const e=n[t];i.addEventListener(t,e);this.on("dispose",(s=>i.removeEventListener(t,e)))}));this.on("loadstart",r);this.on("dispose",(t=>this.off("loadstart",r)))}proxyNativeTracks_(){du.names.forEach((t=>{this.proxyNativeTracksForType_(t)}))}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)}Of.disposeMediaElement(t);t=e}else{t=l.createElement("video");const e=this.options_.tag&&ua(this.options_.tag);const i=Io({},e);if(!Ho||this.options_.nativeControlsForTouch!==true){delete i.controls}ha(t,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){fa(t,"preload",this.options_.preload)}if(this.options_.disablePictureInPicture!==undefined){t.disablePictureInPicture=this.options_.disablePictureInPicture}const e=["loop","muted","playsinline","autoplay"];for(let i=0;i<e.length;i++){const s=e[i];const n=this.options_[s];if(typeof n!=="undefined"){if(n){fa(t,s,s)}else{la(t,s)}t[s]=n}}return t}handleLateInit_(t){if(t.networkState===0||t.networkState===3){return}if(t.readyState===0){let t=false;const e=function(){t=true};this.on("loadstart",e);const i=function(){if(!t){this.trigger("loadstart")}};this.on("loadedmetadata",i);this.ready((function(){this.off("loadstart",e);this.off("loadedmetadata",i);if(!t){this.trigger("loadstart")}}));return}const e=["loadstart"];e.push("loadedmetadata");if(t.readyState>=2){e.push("loadeddata")}if(t.readyState>=3){e.push("canplay")}if(t.readyState>=4){e.push("canplaythrough")}this.ready((function(){e.forEach((function(t){this.trigger(t)}),this)}))}setScrubbing(t){this.isScrubbing_=t}scrubbing(){return this.isScrubbing_}setCurrentTime(t){try{if(this.isScrubbing_&&this.el_.fastSeek&&Go){this.el_.fastSeek(t)}else{this.el_.currentTime=t}}catch(t){go(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===Infinity&&_o&&Ro&&this.el_.currentTime===0){const t=()=>{if(this.el_.currentTime>0){if(this.el_.duration===Infinity){this.trigger("durationchange")}this.off("timeupdate",t)}};this.on("timeupdate",t);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 t=function(){this.trigger("fullscreenchange",{isFullscreen:false});if(this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()){this.el_.controls=false}};const e=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",t);this.trigger("fullscreenchange",{isFullscreen:true,nativeIOSFullscreen:true})}};this.on("webkitbeginfullscreen",e);this.on("dispose",(()=>{this.off("webkitbeginfullscreen",e);this.off("webkitendfullscreen",t)}))}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==="function"}enterFullScreen(){const t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA){Rh(this.el_.play());this.setTimeout((function(){t.pause();try{t.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}),0)}else{try{t.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}}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(t){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){return this.el_.requestVideoFrameCallback(t)}return super.requestVideoFrameCallback(t)}cancelVideoFrameCallback(t){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){this.el_.cancelVideoFrameCallback(t)}else{super.cancelVideoFrameCallback(t)}}src(t){if(t===undefined){return this.el_.src}this.setSrc(t)}reset(){Of.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc}setControls(t){this.el_.controls=!!t}addTextTrack(t,e,i){if(!this.featuresNativeTextTracks){return super.addTextTrack(t,e,i)}return this.el_.addTextTrack(t,e,i)}createRemoteTextTrack(t){if(!this.featuresNativeTextTracks){return super.createRemoteTextTrack(t)}const e=l.createElement("track");if(t.kind){e.kind=t.kind}if(t.label){e.label=t.label}if(t.language||t.srclang){e.srclang=t.language||t.srclang}if(t.default){e.default=t.default}if(t.id){e.id=t.id}if(t.src){e.src=t.src}return e}addRemoteTextTrack(t,e){const i=super.addRemoteTextTrack(t,e);if(this.featuresNativeTextTracks){this.el().appendChild(i)}return i}removeRemoteTextTrack(t){super.removeRemoteTextTrack(t);if(this.featuresNativeTextTracks){const e=this.$$("track");let i=e.length;while(i--){if(t===e[i]||t===e[i].track){this.el().removeChild(e[i])}}}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}const t={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){t.droppedVideoFrames=this.el().webkitDroppedFrameCount;t.totalVideoFrames=this.el().webkitDecodedFrameCount}if(o.performance){t.creationTime=o.performance.now()}return t}}Ao(Of,"TEST_VID",(function(){if(!Qo()){return}const t=l.createElement("video");const e=l.createElement("track");e.kind="captions";e.srclang="en";e.label="English";t.appendChild(e);return t}));Of.isSupported=function(){try{Of.TEST_VID.volume=.5}catch(t){return false}return!!(Of.TEST_VID&&Of.TEST_VID.canPlayType)};Of.canPlayType=function(t){return Of.TEST_VID.canPlayType(t)};Of.canPlaySource=function(t,e){return Of.canPlayType(t.type)};Of.canControlVolume=function(){try{const t=Of.TEST_VID.volume;Of.TEST_VID.volume=t/2+.1;const e=t!==Of.TEST_VID.volume;if(e&&Xo){o.setTimeout((()=>{if(Of&&Of.prototype){Of.prototype.featuresVolumeControl=t!==Of.TEST_VID.volume}}));return false}return e}catch(t){return false}};Of.canMuteVolume=function(){try{const t=Of.TEST_VID.muted;Of.TEST_VID.muted=!t;if(Of.TEST_VID.muted){fa(Of.TEST_VID,"muted","muted")}else{la(Of.TEST_VID,"muted")}return t!==Of.TEST_VID.muted}catch(t){return false}};Of.canControlPlaybackRate=function(){if(_o&&Ro&&Po<58){return false}try{const t=Of.TEST_VID.playbackRate;Of.TEST_VID.playbackRate=t/2+.1;return t!==Of.TEST_VID.playbackRate}catch(t){return false}};Of.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(l.createElement("video"),"src",{get:t,set:t});Object.defineProperty(l.createElement("audio"),"src",{get:t,set:t});Object.defineProperty(l.createElement("video"),"innerHTML",{get:t,set:t});Object.defineProperty(l.createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return false}return true};Of.supportsNativeTextTracks=function(){return Go||Xo&&Ro};Of.supportsNativeVideoTracks=function(){return!!(Of.TEST_VID&&Of.TEST_VID.videoTracks)};Of.supportsNativeAudioTracks=function(){return!!(Of.TEST_VID&&Of.TEST_VID.audioTracks)};Of.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([t,e]){Ao(Of.prototype,t,(()=>Of[e]()),true)}));Of.prototype.featuresVolumeControl=Of.canControlVolume();Of.prototype.movingMediaElementInDOM=!Xo;Of.prototype.featuresFullscreenResize=true;Of.prototype.featuresProgressEvents=true;Of.prototype.featuresTimeupdateEvents=true;Of.prototype.featuresVideoFrameCallback=!!(Of.TEST_VID&&Of.TEST_VID.requestVideoFrameCallback);Of.disposeMediaElement=function(t){if(!t){return}if(t.parentNode){t.parentNode.removeChild(t)}while(t.hasChildNodes()){t.removeChild(t.firstChild)}t.removeAttribute("src");if(typeof t.load==="function"){(function(){try{t.load()}catch(t){}})()}};Of.resetMediaElement=function(t){if(!t){return}const e=t.querySelectorAll("source");let i=e.length;while(i--){t.removeChild(e[i])}t.removeAttribute("src");if(typeof t.load==="function"){(function(){try{t.load()}catch(t){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(t){Of.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}));["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(t){Of.prototype["set"+bh(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(t){Of.prototype[t]=function(){return this.el_[t]}}));["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(t){Of.prototype["set"+bh(t)]=function(e){this.el_[t]=e}}));["pause","load","play"].forEach((function(t){Of.prototype[t]=function(){return this.el_[t]()}}));gu.withSourceHandlers(Of);Of.nativeSourceHandler={};Of.nativeSourceHandler.canPlayType=function(t){try{return Of.TEST_VID.canPlayType(t)}catch(t){return""}};Of.nativeSourceHandler.canHandleSource=function(t,e){if(t.type){return Of.nativeSourceHandler.canPlayType(t.type)}else if(t.src){const e=nu(t.src);return Of.nativeSourceHandler.canPlayType(`video/${e}`)}return""};Of.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)};Of.nativeSourceHandler.dispose=function(){};Of.registerSourceHandler(Of.nativeSourceHandler);gu.registerTech("Html5",Of);const Lf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];const Rf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};const $f=["tiny","xsmall","small","medium","large","xlarge","huge"];const Pf={};$f.forEach((t=>{const e=t.charAt(0)==="x"?`x-${t.substring(1)}`:t;Pf[t]=`vjs-layout-${e}`}));const Uf={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class Ff extends Sh{constructor(t,e,i){t.id=t.id||e.id||`vjs_video_${Ua()}`;e=Object.assign(Ff.getTagSettings(t),e);e.initChildren=false;e.createEl=false;e.evented=false;e.reportTouchActivity=false;if(!e.language){const i=t.closest("[lang]");if(i){e.language=i.getAttribute("lang")}}super(null,e,i);this.boundDocumentFullscreenChange_=t=>this.documentFullscreenChange_(t);this.boundFullWindowOnEscKey_=t=>this.fullWindowOnEscKey(t);this.boundUpdateStyleEl_=t=>this.updateStyleEl_(t);this.boundApplyInitTime_=t=>this.applyInitTime_(t);this.boundUpdateCurrentBreakpoint_=t=>this.updateCurrentBreakpoint_(t);this.boundHandleTechClick_=t=>this.handleTechClick_(t);this.boundHandleTechDoubleClick_=t=>this.handleTechDoubleClick_(t);this.boundHandleTechTouchStart_=t=>this.handleTechTouchStart_(t);this.boundHandleTechTouchMove_=t=>this.handleTechTouchMove_(t);this.boundHandleTechTouchEnd_=t=>this.handleTechTouchEnd_(t);this.boundHandleTechTap_=t=>this.handleTechTap_(t);this.isFullscreen_=false;this.log=yo(this.id_);this.fsApi_=uo;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_={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=t;this.tagAttributes=t&&ua(t);this.language(this.options_.language);if(e.languages){const t={};Object.getOwnPropertyNames(e.languages).forEach((function(i){t[i.toLowerCase()]=e.languages[i]}));this.languages_=t}else{this.languages_=Ff.prototype.options_.languages}this.resetCache_();this.poster_=e.poster||"";this.controls_=!!e.controls;t.controls=false;t.removeAttribute("controls");this.changingSrc_=false;this.playCallbacks_=[];this.playTerminatedQueue_=[];if(t.hasAttribute("autoplay")){this.autoplay(true)}else{this.autoplay(this.options_.autoplay)}if(e.plugins){Object.keys(e.plugins).forEach((t=>{if(typeof this[t]!=="function"){throw new Error(`plugin "${t}" does not exist`)}}))}this.scrubbing_=false;this.el_=this.createEl();mh(this,{eventBusKey:"el_"});if(this.fsApi_.requestFullscreen){Xa(l,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fluid_){this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}const s=Io(this.options_);if(e.plugins){Object.keys(e.plugins).forEach((t=>{this[t](e.plugins[t])}))}if(e.debug){this.debug(true)}this.options_.playerOptions=s;this.middleware_=[];this.playbackRates(e.playbackRates);if(e.experimentalSvgIcons){const t=new o.DOMParser;const e=t.parseFromString(Fu,"image/svg+xml");const i=e.querySelector("parsererror");if(i){go.warn("Failed to load SVG Icons. Falling back to Font Icons.");this.options_.experimentalSvgIcons=null}else{const t=e.documentElement;t.style.display="none";this.el_.appendChild(t);this.addClass("vjs-svg-icons-enabled")}}this.initChildren();this.isAudio(t.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(Ho){this.addClass("vjs-touch-enabled")}if(!Xo){this.addClass("vjs-workinghover")}Ff.players[this.id_]=this;const n=so.split(".")[0];this.addClass(`vjs-v${n}`);this.userActive(true);this.reportUserActivity();this.one("play",(t=>this.listenForUserActivity_(t)));this.on("keydown",(t=>this.handleKeyDown(t)));this.on("languagechange",(t=>this.handleLanguagechange(t)));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");Ga(l,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);Ga(l,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}Ff.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}Nu(this);mu.names.forEach((t=>{const e=mu[t];const i=this[e.getterName]();if(i&&i.off){i.off()}}));super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let t=this.tag;let e;let i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";if(i){e=this.el_=t.parentNode}else if(!s){e=this.el_=super.createEl("div")}const n=ua(t);if(s){e=this.el_=t;t=this.tag=l.createElement("video");while(e.children.length){t.appendChild(e.firstChild)}if(!na(e,"video-js")){ra(e,"video-js")}e.appendChild(t);i=this.playerElIngest_=e;Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(t){}}))}t.setAttribute("tabindex","-1");n.tabindex="-1";if(Ro&&Bo){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(i){if(!(s&&i==="class")){e.setAttribute(i,n[i])}if(s){t.setAttribute(i,n[i])}}));t.playerId=t.id;t.id+="_html5_api";t.className="vjs-tech";t.player=e.player=this;this.addClass("vjs-paused");if(o.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=Oa("vjs-styles-dimensions");const t=Ea(".vjs-styles-defaults");const e=Ea("head");e.insertBefore(this.styleEl_,t?t.nextSibling:e.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 r=t.getElementsByTagName("a");for(let t=0;t<r.length;t++){const e=r.item(t);ra(e,"vjs-hidden");e.setAttribute("hidden","hidden")}t.initNetworkState_=t.networkState;if(t.parentNode&&!i){t.parentNode.insertBefore(e,t)}sa(t,e);this.children_.unshift(t);this.el_.setAttribute("lang",this.language_);this.el_.setAttribute("translate","no");this.el_=e;return e}crossOrigin(t){if(typeof t==="undefined"){return this.techGet_("crossOrigin")}if(t!==null&&t!=="anonymous"&&t!=="use-credentials"){go.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${t}"`);return}this.techCall_("setCrossOrigin",t);if(this.posterImage){this.posterImage.crossOrigin(t)}return}width(t){return this.dimension("width",t)}height(t){return this.dimension("height",t)}dimension(t,e){const i=t+"_";if(e===undefined){return this[i]||0}if(e===""||e==="auto"){this[i]=undefined;this.updateStyleEl_();return}const s=parseFloat(e);if(isNaN(s)){go.error(`Improper value "${e}" supplied for for ${t}`);return}this[i]=s;this.updateStyleEl_()}fluid(t){if(t===undefined){return!!this.fluid_}this.fluid_=!!t;if(oh(this)){this.off(["playerreset","resize"],this.boundUpdateStyleEl_)}if(t){this.addClass("vjs-fluid");this.fill(false);ah(this,(()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}))}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()}fill(t){if(t===undefined){return!!this.fill_}this.fill_=!!t;if(t){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}}aspectRatio(t){if(t===undefined){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(t)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=t;this.fluid(true);this.updateStyleEl_()}updateStyleEl_(){if(o.VIDEOJS_NO_DYNAMIC_STYLE===true){const t=typeof this.width_==="number"?this.width_:this.options_.width;const e=typeof this.height_==="number"?this.height_:this.options_.height;const i=this.tech_&&this.tech_.el();if(i){if(t>=0){i.width=t}if(e>=0){i.height=e}}return}let t;let e;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){t=this.width_}else if(this.height_!==undefined){t=this.height_/r}else{t=this.videoWidth()||300}if(this.height_!==undefined){e=this.height_}else{e=t*r}if(/^[^a-zA-Z]/.test(this.id())){s="dimensions-"+this.id()}else{s=this.id()+"-dimensions"}this.addClass(s);La(this.styleEl_,`\n .${s} {\n width: ${t}px;\n height: ${e}px;\n }\n\n .${s}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${r*100}%;\n }\n `)}loadTech_(t,e){if(this.tech_){this.unloadTech_()}const i=bh(t);const s=t.charAt(0).toLowerCase()+t.slice(1);if(i!=="Html5"&&this.tag){gu.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:e,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};mu.names.forEach((t=>{const e=mu[t];r[e.getterName]=this[e.privateName]}));Object.assign(r,this.options_[i]);Object.assign(r,this.options_[s]);Object.assign(r,this.options_[t.toLowerCase()]);if(this.tag){r.tag=this.tag}if(e&&e.src===this.cache_.src&&this.cache_.currentTime>0){r.startTime=this.cache_.currentTime}const o=gu.getTech(t);if(!o){throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`)}this.tech_=new o(r);this.tech_.ready(Za(this,this.handleTechReady_),true);Fh.jsonToTextTracks(this.textTracksJson_||[],this.tech_);Lf.forEach((t=>{this.on(this.tech_,t,(e=>this[`handleTech${bh(t)}_`](e)))}));Object.keys(Rf).forEach((t=>{this.on(this.tech_,t,(e=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Rf[t]}_`].bind(this),event:e});return}this[`handleTech${Rf[t]}_`](e)}))}));this.on(this.tech_,"loadstart",(t=>this.handleTechLoadStart_(t)));this.on(this.tech_,"sourceset",(t=>this.handleTechSourceset_(t)));this.on(this.tech_,"waiting",(t=>this.handleTechWaiting_(t)));this.on(this.tech_,"ended",(t=>this.handleTechEnded_(t)));this.on(this.tech_,"seeking",(t=>this.handleTechSeeking_(t)));this.on(this.tech_,"play",(t=>this.handleTechPlay_(t)));this.on(this.tech_,"pause",(t=>this.handleTechPause_(t)));this.on(this.tech_,"durationchange",(t=>this.handleTechDurationChange_(t)));this.on(this.tech_,"fullscreenchange",((t,e)=>this.handleTechFullscreenChange_(t,e)));this.on(this.tech_,"fullscreenerror",((t,e)=>this.handleTechFullscreenError_(t,e)));this.on(this.tech_,"enterpictureinpicture",(t=>this.handleTechEnterPictureInPicture_(t)));this.on(this.tech_,"leavepictureinpicture",(t=>this.handleTechLeavePictureInPicture_(t)));this.on(this.tech_,"error",(t=>this.handleTechError_(t)));this.on(this.tech_,"posterchange",(t=>this.handleTechPosterChange_(t)));this.on(this.tech_,"textdata",(t=>this.handleTechTextData_(t)));this.on(this.tech_,"ratechange",(t=>this.handleTechRateChange_(t)));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)){sa(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}}unloadTech_(){mu.names.forEach((t=>{const e=mu[t];this[e.privateName]=this[e.getterName]()}));this.textTracksJson_=Fh.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false}tech(t){if(t===undefined){go.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_}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_(t){if(!this.tech_||typeof t!=="string"){return}const e=()=>{const t=this.muted();this.muted(true);const e=()=>{this.muted(t)};this.playTerminatedQueue_.push(e);const i=this.play();if(!Lh(i)){return}return i.catch((t=>{e();throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${t?t:""}`)}))};let i;if(t==="any"&&!this.muted()){i=this.play();if(Lh(i)){i=i.catch(e)}}else if(t==="muted"&&!this.muted()){i=e()}else{i=this.play()}if(!Lh(i)){return}return i.then((()=>{this.trigger({type:"autoplay-success",autoplay:t})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:t})}))}updateSourceCaches_(t=""){let e=t;let i="";if(typeof e!=="string"){e=t.src;i=t.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(e&&!i){i=$u(this,e)}this.cache_.source=Io({},t,{src:e,type:i});const s=this.cache_.sources.filter((t=>t.src&&t.src===e));const n=[];const r=this.$$("source");const o=[];for(let t=0;t<r.length;t++){const i=ua(r[t]);n.push(i);if(i.src&&i.src===e){o.push(i.src)}}if(o.length&&!s.length){this.cache_.sources=n}else if(!s.length){this.cache_.sources=[this.cache_.source]}this.cache_.src=e}handleTechSourceset_(t){if(!this.changingSrc_){let e=t=>this.updateSourceCaches_(t);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"],(t=>{if(t.type==="sourceset"){return}const e=this.techGet_("currentSrc");this.lastSource_.tech=e;this.updateSourceCaches_(e)}))}}this.lastSource_={player:this.currentSource().src,tech:t.src};this.trigger({src:t.src,type:"sourceset"})}hasStarted(t){if(t===undefined){return this.hasStarted_}if(t===this.hasStarted_){return}this.hasStarted_=t;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((t=>t.callback(t.event)));this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting");this.trigger("waiting");const t=this.currentTime();const e=()=>{if(t!==this.currentTime()){this.removeClass("vjs-waiting");this.off("timeupdate",e)}};this.on("timeupdate",e)}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_(t){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,t)}else if(this.paused()){Rh(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_(t){if(t.cancelable){t.preventDefault()}}toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}}documentFullscreenChange_(t){const e=t.target.player;if(e&&e!==this){return}const i=this.el();let s=l[this.fsApi_.fullscreenElement]===i;if(!s&&i.matches){s=i.matches(":"+this.fsApi_.fullscreen)}this.isFullscreen(s)}handleTechFullscreenChange_(t,e){if(e){if(e.nativeIOSFullscreen){this.addClass("vjs-ios-native-fs");this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))}this.isFullscreen(e.isFullscreen)}}handleTechFullscreenError_(t,e){this.trigger("fullscreenerror",e)}togglePictureInPictureClass_(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}}handleTechEnterPictureInPicture_(t){this.isInPictureInPicture(true)}handleTechLeavePictureInPicture_(t){this.isInPictureInPicture(false)}handleTechError_(){const t=this.tech_.error();this.error(t)}handleTechTextData_(){let t=null;if(arguments.length>1){t=arguments[1]}this.trigger("textdata",t)}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_(t,e){this.ready((function(){if(t in Du){return Iu(this.middleware_,this.tech_,t,e)}else if(t in Cu){return xu(this.middleware_,this.tech_,t,e)}try{if(this.tech_){this.tech_[t](e)}}catch(t){go(t);throw t}}),true)}techGet_(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in Au){return Eu(this.middleware_,this.tech_,t)}else if(t in Cu){return xu(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined){go(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`,e);throw e}if(e.name==="TypeError"){go(`Video.js: ${t} unavailable on ${this.techName_} playback technology element.`,e);this.tech_.isReady_=false;throw e}go(e);throw e}}play(){return new Promise((t=>{this.play_(t)}))}play_(t=Rh){this.playCallbacks_.push(t);const e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));const i=Boolean(Go||Xo);if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!e){this.waitToPlay_=t=>{this.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!e&&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 t=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];t.forEach((function(t){t()}))}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")||xh(0,0)}scrubbing(t){if(typeof t==="undefined"){return this.scrubbing_}this.scrubbing_=!!t;this.techCall_("setScrubbing",this.scrubbing_);if(t){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}}currentTime(t){if(t===undefined){this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime}if(t<0){t=0}if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=t;this.off("canplay",this.boundApplyInitTime_);this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",t);this.cache_.initTime=0;if(isFinite(t)){this.cache_.currentTime=Number(t)}}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(t){if(t===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}t=parseFloat(t);if(t<0){t=Infinity}if(t!==this.cache_.duration){this.cache_.duration=t;if(t===Infinity){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(t)){this.trigger("durationchange")}}}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let t=this.techGet_("buffered");if(!t||!t.length){t=xh(0,0)}return t}bufferedPercent(){return Mh(this.buffered(),this.duration())}bufferedEnd(){const t=this.buffered();const e=this.duration();let i=t.end(t.length-1);if(i>e){i=e}return i}volume(t){let e;if(t!==undefined){e=Math.max(0,Math.min(1,t));this.cache_.volume=e;this.techCall_("setVolume",e);if(e>0){this.lastVolume_(e)}return}e=parseFloat(this.techGet_("volume"));return isNaN(e)?1:e}muted(t){if(t!==undefined){this.techCall_("setMuted",t);return}return this.techGet_("muted")||false}defaultMuted(t){if(t!==undefined){this.techCall_("setDefaultMuted",t)}return this.techGet_("defaultMuted")||false}lastVolume_(t){if(t!==undefined&&t!==0){this.cache_.lastVolume=t;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||false}isFullscreen(t){if(t!==undefined){const e=this.isFullscreen_;this.isFullscreen_=Boolean(t);if(this.isFullscreen_!==e&&this.fsApi_.prefixed){this.trigger("fullscreenchange")}this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(t){if(this.isInPictureInPicture()){this.exitPictureInPicture()}const e=this;return new Promise(((i,s)=>{function n(){e.off("fullscreenerror",o);e.off("fullscreenchange",r)}function r(){n();i()}function o(t,e){n();s(e)}e.one("fullscreenchange",r);e.one("fullscreenerror",o);const a=e.requestFullscreenHelper_(t);if(a){a.then(n,n);a.then(i,s)}}))}requestFullscreenHelper_(t){let e;if(!this.fsApi_.prefixed){e=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(t!==undefined){e=t}}if(this.fsApi_.requestFullscreen){const t=this.el_[this.fsApi_.requestFullscreen](e);if(t){t.then((()=>this.isFullscreen(true)),(()=>this.isFullscreen(false)))}return t}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("enterFullScreen")}else{this.enterFullWindow()}}exitFullscreen(){const t=this;return new Promise(((e,i)=>{function s(){t.off("fullscreenerror",r);t.off("fullscreenchange",n)}function n(){s();e()}function r(t,e){s();i(e)}t.one("fullscreenchange",n);t.one("fullscreenerror",r);const o=t.exitFullscreenHelper_();if(o){o.then(s,s);o.then(e,i)}}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const t=l[this.fsApi_.exitFullscreen]();if(t){Rh(t.then((()=>this.isFullscreen(false))))}return t}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("exitFullScreen")}else{this.exitFullWindow()}}enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=l.documentElement.style.overflow;Xa(l,"keydown",this.boundFullWindowOnEscKey_);l.documentElement.style.overflow="hidden";ra(l.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(t){if(d.isEventKey(t,"Esc")){if(this.isFullscreen()===true){if(!this.isFullWindow){this.exitFullscreen()}else{this.exitFullWindow()}}}}exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;Ga(l,"keydown",this.boundFullWindowOnEscKey_);l.documentElement.style.overflow=this.docOrigOverflow;oa(l.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(t){if(t===undefined){return this.techGet_("disablePictureInPicture")}this.techCall_("setDisablePictureInPicture",t);this.options_.disablePictureInPicture=t;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(t){if(t!==undefined){this.isInPictureInPicture_=!!t;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&o.documentPictureInPicture){const t=l.createElement(this.el().tagName);t.classList=this.el().classList;t.classList.add("vjs-pip-container");if(this.posterImage){t.appendChild(this.posterImage.el().cloneNode(true))}if(this.titleBar){t.appendChild(this.titleBar.el().cloneNode(true))}t.appendChild(ea("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture")));return o.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((e=>{Aa(e);this.el_.parentNode.insertBefore(t,this.el_);e.document.body.appendChild(this.el_);e.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(true);this.player_.trigger("enterpictureinpicture");e.addEventListener("pagehide",(e=>{const i=e.target.querySelector(".video-js");t.parentNode.replaceChild(i,t);this.player_.isInPictureInPicture(false);this.player_.trigger("leavepictureinpicture")}));return e}))}if("pictureInPictureEnabled"in l&&this.disablePictureInPicture()===false){return this.techGet_("requestPictureInPicture")}return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(o.documentPictureInPicture&&o.documentPictureInPicture.window){o.documentPictureInPicture.window.close();return Promise.resolve()}if("pictureInPictureEnabled"in l){return l.exitPictureInPicture()}}handleKeyDown(t){const{userActions:e}=this.options_;if(!e||!e.hotkeys){return}const i=t=>{const e=t.tagName.toLowerCase();if(t.isContentEditable){return true}const i=["button","checkbox","hidden","radio","reset","submit"];if(e==="input"){return i.indexOf(t.type)===-1}const s=["textarea"];return s.indexOf(e)!==-1};if(i(this.el_.ownerDocument.activeElement)){return}if(typeof e.hotkeys==="function"){e.hotkeys.call(this,t)}else{this.handleHotkeys(t)}}handleHotkeys(t){const e=this.options_.userActions?this.options_.userActions.hotkeys:{};const{fullscreenKey:i=(t=>d.isEventKey(t,"f")),muteKey:s=(t=>d.isEventKey(t,"m")),playPauseKey:n=(t=>d.isEventKey(t,"k")||d.isEventKey(t,"Space"))}=e;if(i.call(this,t)){t.preventDefault();t.stopPropagation();const e=Sh.getComponent("FullscreenToggle");if(l[this.fsApi_.fullscreenEnabled]!==false){e.prototype.handleClick.call(this,t)}}else if(s.call(this,t)){t.preventDefault();t.stopPropagation();const e=Sh.getComponent("MuteToggle");e.prototype.handleClick.call(this,t)}else if(n.call(this,t)){t.preventDefault();t.stopPropagation();const e=Sh.getComponent("PlayToggle");e.prototype.handleClick.call(this,t)}}canPlayType(t){let e;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let r=gu.getTech(n);if(!r){r=Sh.getComponent(n)}if(!r){go.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(r.isSupported()){e=r.canPlayType(t);if(e){return e}}}return""}selectSource(t){const e=this.options_.techOrder.map((t=>[t,gu.getTech(t)])).filter((([t,e])=>{if(e){return e.isSupported()}go.error(`The "${t}" tech is undefined. Skipped browser support check for that tech.`);return false}));const i=function(t,e,i){let s;t.some((t=>e.some((e=>{s=i(t,e);if(s){return true}}))));return s};let s;const n=t=>(e,i)=>t(i,e);const r=([t,e],i)=>{if(e.canPlaySource(i,this.options_[t.toLowerCase()])){return{source:i,tech:t}}};if(this.options_.sourceOrder){s=i(t,e,n(r))}else{s=i(e,t,r)}return s||false}handleSrc_(t,e){if(typeof t==="undefined"){return this.cache_.src||""}if(this.resetRetryOnError_){this.resetRetryOnError_()}const i=Pu(t);if(!i.length){this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0);return}this.changingSrc_=true;if(!e){this.cache_.sources=i}this.updateSourceCaches_(i[0]);Su(this,i[0],((t,s)=>{this.middleware_=s;if(!e){this.cache_.sources=i}this.updateSourceCaches_(t);const n=this.src_(t);if(n){if(i.length>1){return this.handleSrc_(i.slice(1))}this.changingSrc_=false;this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0);this.triggerReady();return}ku(s,this.tech_)}));if(i.length>1){const t=()=>{this.error(null);this.handleSrc_(i.slice(1),true)};const e=()=>{this.off("error",t)};this.one("error",t);this.one("playing",e);this.resetRetryOnError_=()=>{this.off("error",t);this.off("playing",e)}}}src(t){return this.handleSrc_(t,false)}src_(t){const e=this.selectSource([t]);if(!e){return true}if(!wh(e.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(e.tech,e.source);this.tech_.ready((()=>{this.changingSrc_=false}));return false}this.ready((function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",t)}else{this.techCall_("src",t.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 t=this.play();Rh(t.then((()=>this.doReset_())))}}doReset_(){if(this.tech_){this.tech_.clearTracks("text")}this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();if(oh(this)){this.trigger("playerreset")}}resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:t,durationDisplay:e,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{};const{seekBar:n}=i||{};if(t){t.updateContent()}if(e){e.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 t=this.currentSource();const e=[];if(Object.keys(t).length!==0){e.push(t)}return this.cache_.sources||e}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(t){if(t!==undefined){this.techCall_("setPreload",t);this.options_.preload=t;return}return this.techGet_("preload")}autoplay(t){if(t===undefined){return this.options_.autoplay||false}let e;if(typeof t==="string"&&/(any|play|muted)/.test(t)||t===true&&this.options_.normalizeAutoplay){this.options_.autoplay=t;this.manualAutoplay_(typeof t==="string"?t:"play");e=false}else if(!t){this.options_.autoplay=false}else{this.options_.autoplay=true}e=typeof e==="undefined"?this.options_.autoplay:e;if(this.tech_){this.techCall_("setAutoplay",e)}}playsinline(t){if(t!==undefined){this.techCall_("setPlaysinline",t);this.options_.playsinline=t}return this.techGet_("playsinline")}loop(t){if(t!==undefined){this.techCall_("setLoop",t);this.options_.loop=t;return}return this.techGet_("loop")}poster(t){if(t===undefined){return this.poster_}if(!t){t=""}if(t===this.poster_){return}this.poster_=t;this.techCall_("setPoster",t);this.isPosterFromTech_=false;this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const t=this.tech_.poster()||"";if(t!==this.poster_){this.poster_=t;this.isPosterFromTech_=true;this.trigger("posterchange")}}}controls(t){if(t===undefined){return!!this.controls_}t=!!t;if(this.controls_===t){return}this.controls_=t;if(this.usingNativeControls()){this.techCall_("setControls",t)}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(t){if(t===undefined){return!!this.usingNativeControls_}t=!!t;if(this.usingNativeControls_===t){return}this.usingNativeControls_=t;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}}error(t){if(t===undefined){return this.error_||null}ro("beforeerror").forEach((e=>{const i=e(this,t);if(!(ko(i)&&!Array.isArray(i)||typeof i==="string"||typeof i==="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}t=i}));if(this.options_.suppressNotSupportedError&&t&&t.code===4){const e=function(){this.error(t)};this.options_.suppressNotSupportedError=false;this.any(["click","touchstart"],e);this.one("loadstart",(function(){this.off(["click","touchstart"],e)}));return}if(t===null){this.error_=null;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new Oh(t);this.addClass("vjs-error");go.error(`(CODE:${this.error_.code} ${Oh.errorTypes[this.error_.code]})`,this.error_.message,this.error_);this.trigger("error");ro("error").forEach((t=>t(this,this.error_)));return}reportUserActivity(t){this.userActivity_=true}userActive(t){if(t===undefined){return this.userActive_}t=!!t;if(t===this.userActive_){return}this.userActive_=t;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(t){t.stopPropagation();t.preventDefault()}))}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}listenForUserActivity_(){let t;let e;let i;const s=Za(this,this.reportUserActivity);const n=function(t){if(t.screenX!==e||t.screenY!==i){e=t.screenX;i=t.screenY;s()}};const r=function(){s();this.clearInterval(t);t=this.setInterval(s,250)};const o=function(e){s();this.clearInterval(t)};this.on("mousedown",r);this.on("mousemove",n);this.on("mouseup",o);this.on("mouseleave",o);const a=this.getChild("controlBar");if(a&&!Xo&&!_o){a.on("mouseenter",(function(t){if(this.player().options_.inactivityTimeout!==0){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout}this.player().options_.inactivityTimeout=0}));a.on("mouseleave",(function(t){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))}this.on("keydown",s);this.on("keyup",s);let h;const u=function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(h);const t=this.options_.inactivityTimeout;if(t<=0){return}h=this.setTimeout((function(){if(!this.userActivity_){this.userActive(false)}}),t)};this.setInterval(u,250)}playbackRate(t){if(t!==undefined){this.techCall_("setPlaybackRate",t);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1}defaultPlaybackRate(t){if(t!==undefined){return this.techCall_("setDefaultPlaybackRate",t)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1}isAudio(t){if(t!==undefined){this.isAudio_=!!t;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const t=this.children();const e=this.getChild("ControlBar");const i=e&&e.currentHeight();t.forEach((t=>{if(t===e){return}if(t.el_&&!t.hasClass("vjs-hidden")){t.hide();this.audioOnlyCache_.hiddenChildren.push(t)}}));this.audioOnlyCache_.playerHeight=this.currentHeight();this.height(i);this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode");this.audioOnlyCache_.hiddenChildren.forEach((t=>t.show()));this.height(this.audioOnlyCache_.playerHeight);this.trigger("audioonlymodechange")}audioOnlyMode(t){if(typeof t!=="boolean"||t===this.audioOnlyMode_){return this.audioOnlyMode_}this.audioOnlyMode_=t;if(t){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 t=this.tech_&&this.tech_;t.hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){const t=this.tech_&&this.tech_;t.show();this.removeClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}audioPosterMode(t){if(typeof t!=="boolean"||t===this.audioPosterMode_){return this.audioPosterMode_}this.audioPosterMode_=t;if(t){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(t,e,i){if(this.tech_){return this.tech_.addTextTrack(t,e,i)}}addRemoteTextTrack(t,e){if(this.tech_){return this.tech_.addRemoteTextTrack(t,e)}}removeRemoteTextTrack(t={}){let{track:e}=t;if(!e){e=t}if(this.tech_){return this.tech_.removeRemoteTextTrack(e)}}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(t){if(t===undefined){return this.language_}if(this.language_!==String(t).toLowerCase()){this.language_=String(t).toLowerCase();if(oh(this)){this.trigger("languagechange")}}}languages(){return Io(Ff.prototype.options_.languages,this.languages_)}toJSON(){const t=Io(this.options_);const e=t.tracks;t.tracks=[];for(let i=0;i<e.length;i++){let s=e[i];s=Io(s);s.player=undefined;t.tracks[i]=s}return t}createModal(t,e){e=e||{};e.content=t||"";const i=new qh(this,e);this.addChild(i);i.on("dispose",(()=>{this.removeChild(i)}));i.open();return i}updateCurrentBreakpoint_(){if(!this.responsive()){return}const t=this.currentBreakpoint();const e=this.currentWidth();for(let i=0;i<$f.length;i++){const s=$f[i];const n=this.breakpoints_[s];if(e<=n){if(t===s){return}if(t){this.removeClass(Pf[t])}this.addClass(Pf[s]);this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const t=this.currentBreakpointClass();this.breakpoint_="";if(t){this.removeClass(t)}}breakpoints(t){if(t===undefined){return Object.assign(this.breakpoints_)}this.breakpoint_="";this.breakpoints_=Object.assign({},Uf,t);this.updateCurrentBreakpoint_();return Object.assign(this.breakpoints_)}responsive(t){if(t===undefined){return this.responsive_}t=Boolean(t);const e=this.responsive_;if(t===e){return}this.responsive_=t;if(t){this.on("playerresize",this.boundUpdateCurrentBreakpoint_);this.updateCurrentBreakpoint_()}else{this.off("playerresize",this.boundUpdateCurrentBreakpoint_);this.removeCurrentBreakpoint_()}return t}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Pf[this.breakpoint_]||""}loadMedia(t,e){if(!t||typeof t!=="object"){return}const i=this.crossOrigin();this.reset();this.cache_.media=Io(t);const{artist:s,artwork:n,description:r,poster:o,src:a,textTracks:h,title:u}=this.cache_.media;if(!n&&o){this.cache_.media.artwork=[{src:o,type:Ru(o)}]}if(i){this.crossOrigin(i)}if(a){this.src(a)}if(o){this.poster(o)}if(Array.isArray(h)){h.forEach((t=>this.addRemoteTextTrack(t,false)))}if(this.titleBar){this.titleBar.update({title:u,description:r||s||""})}this.ready(e)}getMedia(){if(!this.cache_.media){const t=this.poster();const e=this.currentSources();const i=Array.prototype.map.call(this.remoteTextTracks(),(t=>({kind:t.kind,label:t.label,language:t.language,src:t.src})));const s={src:e,textTracks:i};if(t){s.poster=t;s.artwork=[{src:s.poster,type:Ru(s.poster)}]}return s}return Io(this.cache_.media)}static getTagSettings(t){const e={sources:[],tracks:[]};const i=ua(t);const s=i["data-setup"];if(na(t,"vjs-fill")){i.fill=true}if(na(t,"vjs-fluid")){i.fluid=true}if(s!==null){const[t,e]=p(s||"{}");if(t){go.error(t)}Object.assign(i,e)}Object.assign(e,i);if(t.hasChildNodes()){const i=t.childNodes;for(let t=0,s=i.length;t<s;t++){const s=i[t];const n=s.nodeName.toLowerCase();if(n==="source"){e.sources.push(ua(s))}else if(n==="track"){e.tracks.push(ua(s))}}}return e}debug(t){if(t===undefined){return this.debugEnabled_}if(t){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(t){if(t===undefined){return this.cache_.playbackRates}if(!Array.isArray(t)){return}if(!t.every((t=>typeof t==="number"))){return}this.cache_.playbackRates=t;this.trigger("playbackrateschange")}}mu.names.forEach((function(t){const e=mu[t];Ff.prototype[e.getterName]=function(){if(this.tech_){return this.tech_[e.getterName]()}this[e.privateName]=this[e.privateName]||new e.ListClass;return this[e.privateName]}}));Ff.prototype.crossorigin=Ff.prototype.crossOrigin;Ff.players={};const Bf=o.navigator;Ff.prototype.options_={techOrder:gu.defaultTechOrder_,html5:{},enableSourceset:true,inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Bf&&(Bf.languages&&Bf.languages[0]||Bf.userLanguage||Bf.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};["ended","seeking","seekable","networkState","readyState"].forEach((function(t){Ff.prototype[t]=function(){return this.techGet_(t)}}));Lf.forEach((function(t){Ff.prototype[`handleTech${bh(t)}_`]=function(){return this.trigger(t)}}));Sh.registerComponent("Player",Ff);const qf="plugin";const Vf="activePlugins_";const Hf={};const zf=t=>Hf.hasOwnProperty(t);const Xf=t=>zf(t)?Hf[t]:undefined;const Gf=(t,e)=>{t[Vf]=t[Vf]||{};t[Vf][e]=true};const Wf=(t,e,i)=>{const s=(i?"before":"")+"pluginsetup";t.trigger(s,e);t.trigger(s+":"+e.name,e)};const Yf=function(t,e){const i=function(){Wf(this,{name:t,plugin:e,instance:null},true);const i=e.apply(this,arguments);Gf(this,t);Wf(this,{name:t,plugin:e,instance:i});return i};Object.keys(e).forEach((function(t){i[t]=e[t]}));return i};const Kf=(t,e)=>{e.prototype.name=t;return function(...i){Wf(this,{name:t,plugin:e,instance:null},true);const s=new e(...[this,...i]);this[t]=()=>s;Wf(this,s.getEventHash());return s}};class Qf{constructor(t){if(this.constructor===Qf){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=t;if(!this.log){this.log=this.player.log.createLogger(this.name)}mh(this);delete this.trigger;gh(this,this.constructor.defaultState);Gf(t,this.name);this.dispose=this.dispose.bind(this);t.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(t={}){t.name=this.name;t.plugin=this.constructor;t.instance=this;return t}trigger(t,e={}){return Wa(this.eventBusEl_,t,this.getEventHash(e))}handleStateChanged(t){}dispose(){const{name:t,player:e}=this;this.trigger("dispose");this.off();e.off("dispose",this.dispose);e[Vf][t]=false;this.player=this.state=null;e[t]=Kf(t,Hf[t])}static isBasic(t){const e=typeof t==="string"?Xf(t):t;return typeof e==="function"&&!Qf.prototype.isPrototypeOf(e.prototype)}static registerPlugin(t,e){if(typeof t!=="string"){throw new Error(`Illegal plugin name, "${t}", must be a string, was ${typeof t}.`)}if(zf(t)){go.warn(`A plugin named "${t}" already exists. You may want to avoid re-registering plugins!`)}else if(Ff.prototype.hasOwnProperty(t)){throw new Error(`Illegal plugin name, "${t}", cannot share a name with an existing player method!`)}if(typeof e!=="function"){throw new Error(`Illegal plugin for "${t}", must be a function, was ${typeof e}.`)}Hf[t]=e;if(t!==qf){if(Qf.isBasic(e)){Ff.prototype[t]=Yf(t,e)}else{Ff.prototype[t]=Kf(t,e)}}return e}static deregisterPlugin(t){if(t===qf){throw new Error("Cannot de-register base plugin.")}if(zf(t)){delete Hf[t];delete Ff.prototype[t]}}static getPlugins(t=Object.keys(Hf)){let e;t.forEach((t=>{const i=Xf(t);if(i){e=e||{};e[t]=i}}));return e}static getPluginVersion(t){const e=Xf(t);return e&&e.VERSION||""}}Qf.getPlugin=Xf;Qf.BASE_PLUGIN_NAME=qf;Qf.registerPlugin(qf,Qf);Ff.prototype.usingPlugin=function(t){return!!this[Vf]&&this[Vf][t]===true};Ff.prototype.hasPlugin=function(t){return!!zf(t)};function Jf(t,e){let i=false;return function(...s){if(!i){go.warn(t)}i=true;return e.apply(this,s)}}function Zf(t,e,i,s){return Jf(`${e} is deprecated and will be removed in ${t}.0; please use ${i} instead.`,s)}const tl=t=>t.indexOf("#")===0?t.slice(1):t;function el(t,e,i){let s=el.getPlayer(t);if(s){if(e){go.warn(`Player "${t}" is already initialised. Options will not be applied.`)}if(i){s.ready(i)}return s}const n=typeof t==="string"?Ea("#"+tl(t)):t;if(!Jo(n)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}const r="getRootNode"in n?n.getRootNode()instanceof o.ShadowRoot:false;const a=r?n.getRootNode():n.ownerDocument.body;if(!n.ownerDocument.defaultView||!a.contains(n)){go.warn("The element supplied is not included in the DOM")}e=e||{};if(e.restoreEl===true){e.restoreEl=(n.parentNode&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(true)}ro("beforesetup").forEach((t=>{const i=t(n,Io(e));if(!ko(i)||Array.isArray(i)){go.error("please return an object in beforesetup hooks");return}e=Io(e,i)}));const h=Sh.getComponent("Player");s=new h(n,e,i);ro("setup").forEach((t=>t(s)));return s}el.hooks_=no;el.hooks=ro;el.hook=oo;el.hookOnce=ho;el.removeHook=ao;if(o.VIDEOJS_NO_DYNAMIC_STYLE!==true&&Qo()){let fg=Ea(".vjs-styles-defaults");if(!fg){fg=Oa("vjs-styles-defaults");const lg=Ea("head");if(lg){lg.insertBefore(fg,lg.firstChild)}La(fg,`\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n `)}}Na(1,el);el.VERSION=so;el.options=Ff.prototype.options_;el.getPlayers=()=>Ff.players;el.getPlayer=t=>{const e=Ff.players;let i;if(typeof t==="string"){const s=tl(t);const n=e[s];if(n){return n}i=Ea("#"+s)}else{i=t}if(Jo(i)){const{player:t,playerId:s}=i;if(t||e[s]){return t||e[s]}}};el.getAllPlayers=()=>Object.keys(Ff.players).map((t=>Ff.players[t])).filter(Boolean);el.players=Ff.players;el.getComponent=Sh.getComponent;el.registerComponent=(t,e)=>{if(gu.isTech(e)){go.warn(`The ${t} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`)}return Sh.registerComponent.call(Sh,t,e)};el.getTech=gu.getTech;el.registerTech=gu.registerTech;el.use=Tu;Object.defineProperty(el,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(el.middleware,"TERMINATOR",{value:wu,writeable:false,enumerable:true});el.browser=Wo;el.obj=Do;el.mergeOptions=Zf(9,"videojs.mergeOptions","videojs.obj.merge",Io);el.defineLazyProperty=Zf(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ao);el.bind=Zf(9,"videojs.bind","native Function.prototype.bind",Za);el.registerPlugin=Qf.registerPlugin;el.deregisterPlugin=Qf.deregisterPlugin;el.plugin=(t,e)=>{go.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return Qf.registerPlugin(t,e)};el.getPlugins=Qf.getPlugins;el.getPlugin=Qf.getPlugin;el.getPluginVersion=Qf.getPluginVersion;el.addLanguage=function(t,e){t=(""+t).toLowerCase();el.options.languages=Io(el.options.languages,{[t]:e});return el.options.languages[t]};el.log=go;el.createLogger=yo;el.time=Nh;el.createTimeRange=Zf(9,"videojs.createTimeRange","videojs.time.createTimeRanges",xh);el.createTimeRanges=Zf(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",xh);el.formatTime=Zf(9,"videojs.formatTime","videojs.time.formatTime",_h);el.setFormatTime=Zf(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ch);el.resetFormatTime=Zf(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",jh);el.parseUrl=Zf(9,"videojs.parseUrl","videojs.url.parseUrl",iu);el.isCrossOrigin=Zf(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ru);el.EventTarget=nh;el.any=Ka;el.on=Xa;el.one=Ya;el.off=Ga;el.trigger=Wa;el.xhr=I;el.TextTrack=uu;el.AudioTrack=cu;el.VideoTrack=fu;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((t=>{el[t]=function(){go.warn(`videojs.${t}() is deprecated; use videojs.dom.${t}() instead`);return Da[t].apply(null,arguments)}}));el.computedStyle=Zf(9,"videojs.computedStyle","videojs.dom.computedStyle",xa);el.dom=Da;el.fn=ih;el.num=cc;el.str=Th;el.url=ou;
|
|
25
|
+
/*! @name videojs-contrib-quality-levels @version 4.0.0 @license Apache-2.0 */class il{constructor(t){let e=this;e.id=t.id;e.label=e.id;e.width=t.width;e.height=t.height;e.bitrate=t.bandwidth;e.frameRate=t.frameRate;e.enabled_=t.enabled;Object.defineProperty(e,"enabled",{get(){return e.enabled_()},set(t){e.enabled_(t)}});return e}}class sl extends el.EventTarget{constructor(){super();let t=this;t.levels_=[];t.selectedIndex_=-1;Object.defineProperty(t,"selectedIndex",{get(){return t.selectedIndex_}});Object.defineProperty(t,"length",{get(){return t.levels_.length}});t[Symbol.iterator]=()=>t.levels_.values();return t}addQualityLevel(t){let e=this.getQualityLevelById(t.id);if(e){return e}const i=this.levels_.length;e=new il(t);if(!(""+i in this)){Object.defineProperty(this,i,{get(){return this.levels_[i]}})}this.levels_.push(e);this.trigger({qualityLevel:e,type:"addqualitylevel"});return e}removeQualityLevel(t){let e=null;for(let i=0,s=this.length;i<s;i++){if(this[i]===t){e=this.levels_.splice(i,1)[0];if(this.selectedIndex_===i){this.selectedIndex_=-1}else if(this.selectedIndex_>i){this.selectedIndex_--}break}}if(e){this.trigger({qualityLevel:t,type:"removequalitylevel"})}return e}getQualityLevelById(t){for(let e=0,i=this.length;e<i;e++){const i=this[e];if(i.id===t){return i}}return null}dispose(){this.selectedIndex_=-1;this.levels_.length=0}}sl.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const dg in sl.prototype.allowedEvents_){sl.prototype["on"+dg]=null}var nl="4.0.0";const rl=function(t,e){const i=t.qualityLevels;const s=new sl;const n=function(){s.dispose();t.qualityLevels=i;t.off("dispose",n)};t.on("dispose",n);t.qualityLevels=()=>s;t.qualityLevels.VERSION=nl;return s};const ol=function(t){return rl(this,el.obj.merge({},t))};el.registerPlugin("qualityLevels",ol);ol.VERSION=nl;
|
|
26
|
+
/*! @name @videojs/http-streaming @version 3.5.3 @license Apache-2.0 */const al=wt;const hl=(t,e)=>{if(e&&e.responseURL&&t!==e.responseURL){return e.responseURL}return t};const ul=t=>{if(el.log.debug){return el.log.debug.bind(el,"VHS:",`${t} >`)}return function(){}};function cl(...t){const e=el.obj||el;const i=e.merge||e.mergeOptions;return i.apply(e,t)}function fl(...t){const e=el.time||el;const i=e.createTimeRanges||e.createTimeRanges;return i.apply(e,t)}const ll=1/30;const dl=ll*3;const pl=function(t,e){const i=[];let s;if(t&&t.length){for(s=0;s<t.length;s++){if(e(t.start(s),t.end(s))){i.push([t.start(s),t.end(s)])}}}return fl(i)};const ml=function(t,e){return pl(t,(function(t,i){return t-dl<=e&&i+dl>=e}))};const vl=function(t,e){return pl(t,(function(t){return t-ll>=e}))};const gl=function(t){if(t.length<2){return fl()}const e=[];for(let i=1;i<t.length;i++){const s=t.end(i-1);const n=t.start(i);e.push([s,n])}return fl(e)};const yl=function(t,e){let i=null;let s=null;let n=0;const r=[];const o=[];if(!t||!t.length||!e||!e.length){return fl()}let a=t.length;while(a--){r.push({time:t.start(a),type:"start"});r.push({time:t.end(a),type:"end"})}a=e.length;while(a--){r.push({time:e.start(a),type:"start"});r.push({time:e.end(a),type:"end"})}r.sort((function(t,e){return t.time-e.time}));for(a=0;a<r.length;a++){if(r[a].type==="start"){n++;if(n===2){i=r[a].time}}else if(r[a].type==="end"){n--;if(n===1){s=r[a].time}}if(i!==null&&s!==null){o.push([i,s]);i=null;s=null}}return fl(o)};const bl=t=>{const e=[];if(!t||!t.length){return""}for(let i=0;i<t.length;i++){e.push(t.start(i)+" => "+t.end(i))}return e.join(", ")};const wl=function(t,e,i=1){const s=t.length?t.end(t.length-1):0;return(s-e)/i};const Tl=t=>{const e=[];for(let i=0;i<t.length;i++){e.push({start:t.start(i),end:t.end(i)})}return e};const Sl=function(t,e){if(t===e){return false}if(!t&&e||!e&&t){return true}if(t.length!==e.length){return true}for(let i=0;i<t.length;i++){if(t.start(i)!==e.start(i)||t.end(i)!==e.end(i)){return true}}return false};const kl=function(t){if(!t||!t.length||!t.end){return}return t.end(t.length-1)};const El=function(t,e){let i=0;if(!t||!t.length){return i}for(let s=0;s<t.length;s++){const n=t.start(s);const r=t.end(s);if(e>r){continue}if(e>n&&e<=r){i+=r-e;continue}i+=r-n}return i};const Il=(t,e)=>{if(!e.preload){return e.duration}let i=0;(e.parts||[]).forEach((function(t){i+=t.duration}));(e.preloadHints||[]).forEach((function(e){if(e.type==="PART"){i+=t.partTargetDuration}}));return i};const xl=t=>(t.segments||[]).reduce(((t,e,i)=>{if(e.parts){e.parts.forEach((function(s,n){t.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:e})}))}else{t.push({duration:e.duration,segmentIndex:i,partIndex:null,segment:e,part:null})}return t}),[]);const Al=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]};const Dl=({preloadSegment:t})=>{if(!t){return}const{parts:e,preloadHints:i}=t;let s=(i||[]).reduce(((t,e)=>t+(e.type==="PART"?1:0)),0);s+=e&&e.length?e.length:0;return s};const Cl=(t,e)=>{if(e.endList){return 0}if(t&&t.suggestedPresentationDelay){return t.suggestedPresentationDelay}const i=Al(e).length>0;if(i&&e.serverControl&&e.serverControl.partHoldBack){return e.serverControl.partHoldBack}else if(i&&e.partTargetDuration){return e.partTargetDuration*3}else if(e.serverControl&&e.serverControl.holdBack){return e.serverControl.holdBack}else if(e.targetDuration){return e.targetDuration*3}return 0};const jl=function(t,e){let i=0;let s=e-t.mediaSequence;let n=t.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=t.segments[s];if(typeof n.end!=="undefined"){return{result:i+n.end,precise:true}}i+=Il(t,n);if(typeof n.start!=="undefined"){return{result:i+n.start,precise:true}}}return{result:i,precise:false}};const _l=function(t,e){let i=0;let s;let n=e-t.mediaSequence;for(;n<t.segments.length;n++){s=t.segments[n];if(typeof s.start!=="undefined"){return{result:s.start-i,precise:true}}i+=Il(t,s);if(typeof s.end!=="undefined"){return{result:s.end-i,precise:true}}}return{result:-1,precise:false}};const Nl=function(t,e,i){if(typeof e==="undefined"){e=t.mediaSequence+t.segments.length}if(e<t.mediaSequence){return 0}const s=jl(t,e);if(s.precise){return s.result}const n=_l(t,e);if(n.precise){return n.result}return s.result+i};const Ml=function(t,e,i){if(!t){return 0}if(typeof i!=="number"){i=0}if(typeof e==="undefined"){if(t.totalDuration){return t.totalDuration}if(!t.endList){return o.Infinity}}return Nl(t,e,i)};const Ol=function({defaultDuration:t,durationList:e,startIndex:i,endIndex:s}){let n=0;if(i>s){[i,s]=[s,i]}if(i<0){for(let e=i;e<Math.min(0,s);e++){n+=t}i=0}for(let t=i;t<s;t++){n+=e[t].duration}return n};const Ll=function(t,e,i,s){if(!t||!t.segments){return null}if(t.endList){return Ml(t)}if(e===null){return null}e=e||0;let n=Nl(t,t.mediaSequence+t.segments.length,e);if(i){s=typeof s==="number"?s:Cl(null,t);n-=s}return Math.max(0,n)};const Rl=function(t,e,i){const s=true;const n=e||0;const r=Ll(t,e,s,i);if(r===null){return fl()}return fl(n,r)};const $l=function({playlist:t,currentTime:e,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let o=e-n;const a=xl(t);let h=0;for(let t=0;t<a.length;t++){const e=a[t];if(i!==e.segmentIndex){continue}if(typeof s==="number"&&typeof e.partIndex==="number"&&s!==e.partIndex){continue}h=t;break}if(o<0){if(h>0){for(let e=h-1;e>=0;e--){const i=a[e];o+=i.duration;if(r){if(o<0){continue}}else if(o+ll<=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-Ol({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}}return{partIndex:a[0]&&a[0].partIndex||null,segmentIndex:a[0]&&a[0].segmentIndex||0,startTime:e}}if(h<0){for(let i=h;i<0;i++){o-=t.targetDuration;if(o<0){return{partIndex:a[0]&&a[0].partIndex||null,segmentIndex:a[0]&&a[0].segmentIndex||0,startTime:e}}}h=0}for(let e=h;e<a.length;e++){const i=a[e];o-=i.duration;if(r){if(o>0){continue}}else if(o-ll>=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+Ol({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}return{segmentIndex:a[a.length-1].segmentIndex,partIndex:a[a.length-1].partIndex,startTime:e}};const Pl=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()};const Ul=function(t){return t.excludeUntil&&t.excludeUntil===Infinity};const Fl=function(t){const e=Pl(t);return!t.disabled&&!e};const Bl=function(t){return t.disabled};const ql=function(t){for(let e=0;e<t.segments.length;e++){if(t.segments[e].key){return true}}return false};const Vl=function(t,e){return e.attributes&&e.attributes[t]};const Hl=function(t,e,i,s=0){if(!Vl("BANDWIDTH",i)){return NaN}const n=t*i.attributes.BANDWIDTH;return(n-s*8)/e};const zl=(t,e)=>{if(t.playlists.length===1){return true}const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter((t=>{if(!Fl(t)){return false}return(t.attributes.BANDWIDTH||0)<i})).length===0};const Xl=(t,e)=>{if(!t&&!e||!t&&e||t&&!e){return false}if(t===e){return true}if(t.id&&e.id&&t.id===e.id){return true}if(t.resolvedUri&&e.resolvedUri&&t.resolvedUri===e.resolvedUri){return true}if(t.uri&&e.uri&&t.uri===e.uri){return true}return false};const Gl=function(t,e){const i=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let s=false;for(const t in i){for(const n in i[t]){s=e(i[t][n]);if(s){break}}if(s){break}}return!!s};const Wl=t=>{if(!t||!t.playlists||!t.playlists.length){const e=Gl(t,(t=>t.playlists&&t.playlists.length||t.uri));return e}for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e];const s=i.attributes&&i.attributes.CODECS;if(s&&s.split(",").every((t=>Ft(t)))){continue}const n=Gl(t,(t=>Xl(i,t)));if(n){continue}return false}return true};var Yl={liveEdgeDelay:Cl,duration:Ml,seekable:Rl,getMediaInfoForTime:$l,isEnabled:Fl,isDisabled:Bl,isExcluded:Pl,isIncompatible:Ul,playlistEnd:Ll,isAes:ql,hasAttribute:Vl,estimateSegmentRequestTime:Hl,isLowestEnabledRendition:zl,isAudioOnly:Wl,playlistMatch:Xl,segmentDurationWithParts:Il};const{log:Kl}=el;const Ql=(t,e)=>`${t}-${e}`;const Jl=(t,e,i)=>`placeholder-uri-${t}-${e}-${i}`;const Zl=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const o=new Mt;if(t){o.on("warn",t)}if(e){o.on("info",e)}s.forEach((t=>o.addParser(t)));n.forEach((t=>o.addTagMapper(t)));o.push(i);o.end();const a=o.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(t){if(a.hasOwnProperty(t)){delete a[t]}}));if(a.segments){a.segments.forEach((function(t){["parts","preloadHints"].forEach((function(e){if(t.hasOwnProperty(e)){delete t[e]}}))}))}}if(!a.targetDuration){let e=10;if(a.segments&&a.segments.length){e=a.segments.reduce(((t,e)=>Math.max(t,e.duration)),0)}if(t){t(`manifest has no targetDuration defaulting to ${e}`)}a.targetDuration=e}const h=Al(a);if(h.length&&!a.partTargetDuration){const e=h.reduce(((t,e)=>Math.max(t,e.duration)),0);if(t){t(`manifest has no partTargetDuration defaulting to ${e}`);Kl.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.")}a.partTargetDuration=e}return a};const td=(t,e)=>{if(!t.mediaGroups){return}["AUDIO","SUBTITLES"].forEach((i=>{if(!t.mediaGroups[i]){return}for(const s in t.mediaGroups[i]){for(const n in t.mediaGroups[i][s]){const r=t.mediaGroups[i][s][n];e(r,i,s,n)}}}))};const ed=({playlist:t,uri:e,id:i})=>{t.id=i;t.playlistErrors_=0;if(e){t.uri=e}t.attributes=t.attributes||{}};const id=t=>{let e=t.playlists.length;while(e--){const i=t.playlists[e];ed({playlist:i,id:Ql(e,i.uri)});i.resolvedUri=al(t.uri,i.uri);t.playlists[i.id]=i;t.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){Kl.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const sd=t=>{td(t,(e=>{if(e.uri){e.resolvedUri=al(t.uri,e.uri)}}))};const nd=(t,e)=>{const i=Ql(0,e);const s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:o.location.href,resolvedUri:o.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};s.playlists[i]=s.playlists[0];s.playlists[e]=s.playlists[0];return s};const rd=(t,e,i=Jl)=>{t.uri=e;for(let e=0;e<t.playlists.length;e++){if(!t.playlists[e].uri){const i=`placeholder-uri-${e}`;t.playlists[e].uri=i}}const s=Wl(t);td(t,((e,n,r,o)=>{if(!e.playlists||!e.playlists.length){if(s&&n==="AUDIO"&&!e.uri){for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r){return}}}e.playlists=[g({},e)]}e.playlists.forEach((function(e,s){const a=i(n,r,o,e);const h=Ql(s,a);if(e.uri){e.resolvedUri=e.resolvedUri||al(t.uri,e.uri)}else{e.uri=s===0?a:h;e.resolvedUri=e.uri}e.id=e.id||h;e.attributes=e.attributes||{};t.playlists[e.id]=e;t.playlists[e.uri]=e}))}));id(t);sd(t)};class od{constructor(){this.offset_=null;this.pendingDateRanges_=new Map;this.processedDateRanges_=new Map}setOffset(t=[]){if(this.offset_!==null){return}if(!t.length){return}const[e]=t;if(e.programDateTime===undefined){return}this.offset_=e.programDateTime/1e3}setPendingDateRanges(t=[]){if(!t.length){return}const[e]=t;const i=e.startDate.getTime();this.trimProcessedDateRanges_(i);this.pendingDateRanges_=t.reduce(((t,e)=>{t.set(e.id,e);return t}),new Map)}processDateRange(t){this.pendingDateRanges_.delete(t.id);this.processedDateRanges_.set(t.id,t)}getDateRangesToProcess(){if(this.offset_===null){return[]}const t={};const e=[];this.pendingDateRanges_.forEach(((i,s)=>{if(this.processedDateRanges_.has(s)){return}i.startTime=i.startDate.getTime()/1e3-this.offset_;i.processDateRange=()=>this.processDateRange(i);e.push(i);if(!i.class){return}if(t[i.class]){const e=t[i.class].push(i);i.classListIndex=e-1}else{t[i.class]=[i];i.classListIndex=0}}));for(const i of e){const e=t[i.class]||[];if(i.endDate){i.endTime=i.endDate.getTime()/1e3-this.offset_}else if(i.endOnNext&&e[i.classListIndex+1]){i.endTime=e[i.classListIndex+1].startTime}else if(i.duration){i.endTime=i.startTime+i.duration}else if(i.plannedDuration){i.endTime=i.startTime+i.plannedDuration}else{i.endTime=i.startTime}}return e}trimProcessedDateRanges_(t){const e=new Map(this.processedDateRanges_);e.forEach(((e,i)=>{if(e.startDate.getTime()<t){this.processedDateRanges_.delete(i)}}))}}const{EventTarget:ad}=el;const hd=(t,e)=>{if(e.endList||!e.serverControl){return t}const i={};if(e.serverControl.canBlockReload){const{preloadSegment:t}=e;let s=e.mediaSequence+e.segments.length;if(t){const n=t.parts||[];const r=Dl(e)-1;if(r>-1&&r!==n.length-1){i._HLS_part=r}if(r>-1||n.length){s--}}i._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil){i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(i).length){const e=new o.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(t){if(!i.hasOwnProperty(t)){return}e.searchParams.set(t,i[t])}));t=e.toString()}return t};const ud=(t,e)=>{if(!t){return e}const i=cl(t,e);if(t.preloadHints&&!e.preloadHints){delete i.preloadHints}if(t.parts&&!e.parts){delete i.parts}else if(t.parts&&e.parts){for(let s=0;s<e.parts.length;s++){if(t.parts&&t.parts[s]){i.parts[s]=cl(t.parts[s],e.parts[s])}}}if(!t.skipped&&e.skipped){i.skipped=false}if(t.preload&&!e.preload){i.preload=false}return i};const cd=(t,e,i)=>{const s=t.slice();const n=e.slice();i=i||0;const r=[];let o;for(let t=0;t<n.length;t++){const e=s[t+i];const a=n[t];if(e){o=e.map||o;r.push(ud(e,a))}else{if(o&&!a.map){a.map=o}r.push(a)}}return r};const fd=(t,e)=>{if(!t.resolvedUri&&t.uri){t.resolvedUri=al(e,t.uri)}if(t.key&&!t.key.resolvedUri){t.key.resolvedUri=al(e,t.key.uri)}if(t.map&&!t.map.resolvedUri){t.map.resolvedUri=al(e,t.map.uri)}if(t.map&&t.map.key&&!t.map.key.resolvedUri){t.map.key.resolvedUri=al(e,t.map.key.uri)}if(t.parts&&t.parts.length){t.parts.forEach((t=>{if(t.resolvedUri){return}t.resolvedUri=al(e,t.uri)}))}if(t.preloadHints&&t.preloadHints.length){t.preloadHints.forEach((t=>{if(t.resolvedUri){return}t.resolvedUri=al(e,t.uri)}))}};const ld=function(t){const e=t.segments||[];const i=t.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let t=0;t<i.preloadHints.length;t++){if(i.preloadHints[t].type==="MAP"){return e}}}i.duration=t.targetDuration;i.preload=true;e.push(i)}return e};const dd=(t,e)=>t===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence&&t.preloadSegment===e.preloadSegment;const pd=(t,e,i=dd)=>{const s=cl(t,{});const n=s.playlists[e.id];if(!n){return null}if(i(n,e)){return null}e.segments=ld(e);const r=cl(n,e);if(r.preloadSegment&&!e.preloadSegment){delete r.preloadSegment}if(n.segments){if(e.skip){e.segments=e.segments||[];for(let t=0;t<e.skip.skippedSegments;t++){e.segments.unshift({skipped:true})}}r.segments=cd(n.segments,e.segments,e.mediaSequence-n.mediaSequence)}r.segments.forEach((t=>{fd(t,r.resolvedUri)}));for(let t=0;t<s.playlists.length;t++){if(s.playlists[t].id===e.id){s.playlists[t]=r}}s.playlists[e.id]=r;s.playlists[e.uri]=r;td(t,((t,i,s,n)=>{if(!t.playlists){return}for(let i=0;i<t.playlists.length;i++){if(e.id===t.playlists[i].id){t.playlists[i]=r}}}));return s};const md=(t,e)=>{const i=t.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(e&&r){return r*1e3}return(t.partTargetDuration||t.targetDuration||10)*500};class vd extends ad{constructor(t,e,i={}){super();if(!t){throw new Error("A non-empty playlist URL or object is required")}this.logger_=ul("PlaylistLoader");const{withCredentials:s=false}=i;this.src=t;this.vhs_=e;this.withCredentials=s;this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=e.options_;this.customTagParsers=n&&n.customTagParsers||[];this.customTagMappers=n&&n.customTagMappers||[];this.llhls=n&&n.llhls;this.dateRangesStorage_=new od;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const t=this.media();if(!t){return}this.dateRangesStorage_.setOffset(t.segments);this.dateRangesStorage_.setPendingDateRanges(t.dateRanges);const e=this.dateRangesStorage_.getDateRangesToProcess();if(!e.length||!this.addDateRangesToTextTrack_){return}this.addDateRangesToTextTrack_(e)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const t=this.media();let e=al(this.main.uri,t.uri);if(this.llhls){e=hd(e,t)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:e,withCredentials:this.withCredentials},((t,e)=>{if(!this.request){return}if(t){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(t,e,i){const{uri:s,id:n}=e;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[n],status:t.status,message:`HLS playlist request error at URL: ${s}.`,responseText:t.responseText,code:t.status>=500?4:2};this.trigger("error")}parseManifest_({url:t,manifestString:e}){return Zl({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})}haveMetadata({playlistString:t,playlistObject:e,url:i,id:s}){this.request=null;this.state="HAVE_METADATA";const n=e||this.parseManifest_({url:i,manifestString:t});n.lastRequest=Date.now();ed({playlist:n,uri:i,id:s});const r=pd(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration;this.pendingMedia_=null;if(r){this.main=r;this.media_=this.main.playlists[s]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(md(this.media(),!!r));this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();o.clearTimeout(this.mediaUpdateTimeout);o.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new od;this.off()}stopRequest(){if(this.request){const t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}media(t,e){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof t==="string"){if(!this.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.main.playlists[t]}o.clearTimeout(this.finalRenditionTimeout);if(e){const e=(t.partTargetDuration||t.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=o.setTimeout(this.media.bind(this,t,false),e);return}const i=this.state;const s=!this.media_||t.id!==this.media_.id;const n=this.main.playlists[t.id];if(n&&n.endList||t.endList&&t.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=t;if(s){this.trigger("mediachanging");if(i==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(md(t,true));if(!s){return}this.state="SWITCHING_MEDIA";if(this.request){if(t.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=t;this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},((e,s)=>{if(!this.request){return}t.lastRequest=Date.now();t.resolvedUri=hl(t.resolvedUri,s);if(e){return this.playlistRequestError(this.request,t,i)}this.haveMetadata({playlistString:s.responseText,url:t.uri,id:t.id});if(i==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}))}pause(){if(this.mediaUpdateTimeout){o.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(t){if(this.mediaUpdateTimeout){o.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const e=this.media();if(t){const t=e?(e.partTargetDuration||e.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=o.setTimeout((()=>{this.mediaUpdateTimeout=null;this.load()}),t);return}if(!this.started){this.start();return}if(e&&!e.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(t){if(this.mediaUpdateTimeout){o.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=o.setTimeout((()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(t)}),t)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=o.location.href}this.src.resolvedUri=this.src.uri;setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},((t,e)=>{if(!this.request){return}this.request=null;if(t){this.error={status:e.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:e.responseText,code:2};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.src=hl(this.src,e);const i=this.parseManifest_({manifestString:e.responseText,url:this.src});this.setupInitialPlaylist(i)}))}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(t){this.state="HAVE_MAIN_MANIFEST";if(t.playlists){this.main=t;rd(this.main,this.srcUri());t.playlists.forEach((t=>{t.segments=ld(t);t.segments.forEach((e=>{fd(e,t.resolvedUri)}))}));this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const e=this.srcUri()||o.location.href;this.main=nd(t,e);this.haveMetadata({playlistObject:t,url:e,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}}const{xhr:gd}=el;const yd=function(t,e,i,s){const n=t.responseType==="arraybuffer"?t.response:t.responseText;if(!e&&n){t.responseTime=Date.now();t.roundTripTime=t.responseTime-t.requestTime;t.bytesReceived=n.byteLength||n.length;if(!t.bandwidth){t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3)}}if(i.headers){t.responseHeaders=i.headers}if(e&&e.code==="ETIMEDOUT"){t.timedout=true}if(!e&&!t.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){e=new Error("XHR Failed with a response of: "+(t&&(n||t.responseText)))}s(e,t)};const bd=(t,e)=>{if(!t||!t.size){return}let i=e;t.forEach((t=>{i=t(i)}));return i};const wd=(t,e,i,s)=>{if(!t||!t.size){return}t.forEach((t=>{t(e,i,s)}))};const Td=function(){const t=function t(e,i){e=cl({timeout:45e3},e);const s=t.beforeRequest||el.Vhs.xhr.beforeRequest;const n=t._requestCallbackSet||el.Vhs.xhr._requestCallbackSet||new Set;const r=t._responseCallbackSet||el.Vhs.xhr._responseCallbackSet;if(s&&typeof s==="function"){el.log.warn("beforeRequest is deprecated, use onRequest instead.");n.add(s)}const o=el.Vhs.xhr.original===true?gd:el.Vhs.xhr;const a=bd(n,e);n.delete(s);const h=o(a||e,(function(t,e){wd(r,h,t,e);return yd(h,t,e,i)}));const u=h.abort;h.abort=function(){h.aborted=true;return u.apply(h,arguments)};h.uri=e.uri;h.requestTime=Date.now();return h};t.original=true;return t};const Sd=function(t){let e;const i=t.offset;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){e=o.BigInt(t.offset)+o.BigInt(t.length)-o.BigInt(1)}else{e=t.offset+t.length-1}return"bytes="+i+"-"+e};const kd=function(t){const e={};if(t.byterange){e.Range=Sd(t.byterange)}return e};const Ed=function(t,e){return t.start(e)+"-"+t.end(e)};const Id=function(t,e){const i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")};const xd=function(t){if(t>=32&&t<126){return String.fromCharCode(t)}return"."};const Ad=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(Jt(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};const Dd=function(t){const e=t.byterange||{length:Infinity,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")};const Cd=function(t){return t.resolvedUri};const jd=t=>{const e=Array.prototype.slice.call(t);const i=16;let s="";let n;let r;for(let t=0;t<e.length/i;t++){n=e.slice(t*i,t*i+i).map(Id).join("");r=e.slice(t*i,t*i+i).map(xd).join("");s+=n+" "+r+"\n"}return s};const _d=({bytes:t})=>jd(t);const Nd=t=>{let e="";let i;for(i=0;i<t.length;i++){e+=Ed(t,i)+" "}return e};var Md=Object.freeze({__proto__:null,createTransferableMessage:Ad,initSegmentId:Dd,segmentKeyId:Cd,hexDump:jd,tagDump:_d,textRanges:Nd});const Od=.25;const Ld=(t,e)=>{if(!e.dateTimeObject){return null}const i=e.videoTimingInfo.transmuxerPrependedSeconds;const s=e.videoTimingInfo.transmuxedPresentationStart;const n=s+i;const r=t-n;return new Date(e.dateTimeObject.getTime()+r*1e3)};const Rd=t=>t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds;const $d=(t,e)=>{let i;try{i=new Date(t)}catch(t){return null}if(!e||!e.segments||e.segments.length===0){return null}let s=e.segments[0];if(i<new Date(s.dateTimeObject)){return null}for(let t=0;t<e.segments.length-1;t++){s=e.segments[t];const n=new Date(e.segments[t+1].dateTimeObject);if(i<n){break}}const n=e.segments[e.segments.length-1];const r=n.dateTimeObject;const o=n.videoTimingInfo?Rd(n.videoTimingInfo):n.duration+n.duration*Od;const a=new Date(r.getTime()+o*1e3);if(i>a){return null}if(i>new Date(r)){s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Yl.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}};const Pd=(t,e)=>{if(!e||!e.segments||e.segments.length===0){return null}let i=0;let s;for(let n=0;n<e.segments.length;n++){s=e.segments[n];i=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:i+s.duration;if(t<=i){break}}const n=e.segments[e.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<t){return null}if(t>i){if(t>i+n.duration*Od){return null}s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:i-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}};const Ud=(t,e)=>{let i;let s;try{i=new Date(t);s=new Date(e)}catch(t){}const n=i.getTime();const r=s.getTime();return(r-n)/1e3};const Fd=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 Bd=({playlist:t,time:e=undefined,callback:i})=>{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!t||e===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const s=Pd(e,t);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:e};const r=Ld(e,s.segment);if(r){n.programDateTime=r.toISOString()}return i(null,n)};const qd=({programTime:t,playlist:e,retryCount:i=2,seekTo:s,pauseAfterSeek:n=true,tech:r,callback:o})=>{if(!o){throw new Error("seekToProgramTime: callback must be provided")}if(typeof t==="undefined"||!e||!s){return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!e.endList&&!r.hasStarted_){return o({message:"player must be playing a live stream to start buffering"})}if(!Fd(e)){return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri})}const a=$d(t,e);if(!a){return o({message:`${t} was not found in the stream`})}const h=a.segment;const u=Ud(h.dateTimeObject,t);if(a.type==="estimate"){if(i===0){return o({message:`${t} is not buffered yet. Try again`})}s(a.estimatedStart+u);r.one("seeked",(()=>{qd({programTime:t,playlist:e,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:o})}));return}const c=h.start+u;const f=()=>o(null,r.currentTime());r.one("seeked",f);if(n){r.pause()}s(c)};const Vd=(t,e)=>{if(t.readyState===4){return e()}return};const Hd=(t,e,i)=>{let s=[];let n;let r=false;const o=function(t,e,s,n){e.abort();r=true;return i(t,e,s,n)};const a=function(t,e){if(r){return}if(t){return o(t,e,"",s)}const i=e.responseText.substring(s&&s.byteLength||0,e.responseText.length);s=oe(s,re(i,true));n=n||kr(s);if(s.length<10||n&&s.length<n+2){return Vd(e,(()=>o(t,e,"",s)))}const a=Xr(s);if(a==="ts"&&s.length<188){return Vd(e,(()=>o(t,e,"",s)))}if(!a&&s.length<376){return Vd(e,(()=>o(t,e,"",s)))}return o(null,e,a,s)};const h={uri:t,beforeSend(t){t.overrideMimeType("text/plain; charset=x-user-defined");t.addEventListener("progress",(function({total:e,loaded:i}){return yd(t,null,{statusCode:t.status},a)}))}};const u=e(h,(function(t,e){return yd(u,t,e,a)}));return u};const{EventTarget:zd}=el;const Xd=function(t,e){if(!dd(t,e)){return false}if(t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length)){return false}else if(!t.sidx&&e.sidx||t.sidx&&!e.sidx){return false}if(t.segments&&!e.segments||!t.segments&&e.segments){return false}if(!t.segments&&!e.segments){return true}for(let i=0;i<t.segments.length;i++){const s=t.segments[i];const n=e.segments[i];if(s.uri!==n.uri){return false}if(!s.byterange&&!n.byterange){continue}const r=s.byterange;const o=n.byterange;if(r&&!o||!r&&o){return false}if(r.offset!==o.offset||r.length!==o.length){return false}}return true};const Gd=(t,e,i,s)=>{const n=s.attributes.NAME||i;return`placeholder-uri-${t}-${e}-${n}`};const Wd=({mainXml:t,srcUrl:e,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=dr(t,{manifestUri:e,clientOffset:i,sidxMapping:s,previousManifest:n});rd(r,e,Gd);return r};const Yd=(t,e)=>{td(t,((i,s,n,r)=>{if(!(r in e.mediaGroups[s][n])){delete t.mediaGroups[s][n][r]}}))};const Kd=(t,e,i)=>{let s=true;let n=cl(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let t=0;t<e.playlists.length;t++){const r=e.playlists[t];if(r.sidx){const t=bn(r.sidx);if(i&&i[t]&&i[t].sidx){cn(r,i[t].sidx,r.sidx.resolvedUri)}}const o=pd(n,r,Xd);if(o){n=o;s=false}}td(e,((t,e,i,r)=>{if(t.playlists&&t.playlists.length){const o=t.playlists[0].id;const a=pd(n,t.playlists[0],Xd);if(a){n=a;if(!(r in n.mediaGroups[e][i])){n.mediaGroups[e][i][r]=t}n.mediaGroups[e][i][r].playlists[0]=n.playlists[o];s=false}}}));Yd(n,e);if(e.minimumUpdatePeriod!==t.minimumUpdatePeriod){s=false}if(s){return null}return n};const Qd=(t,e)=>{const i=Boolean(!t.map&&!e.map);const s=i||Boolean(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length);return s&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length};const Jd=(t,e)=>{const i={};for(const s in t){const n=t[s];const r=n.sidx;if(r){const t=bn(r);if(!e[t]){break}const s=e[t].sidxInfo;if(Qd(s,r)){i[t]=e[t]}}}return i};const Zd=(t,e)=>{const i=Jd(t.playlists,e);let s=i;td(t,((t,i,n,r)=>{if(t.playlists&&t.playlists.length){const i=t.playlists;s=cl(s,Jd(i,e))}}));return s};class tp extends zd{constructor(t,e,i={},s){super();this.mainPlaylistLoader_=s||this;if(!s){this.isMain_=true}const{withCredentials:n=false}=i;this.vhs_=e;this.withCredentials=n;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!t){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_=ul("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=t;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=t}}requestErrored_(t,e,i){if(!this.request){return true}this.request=null;if(t){this.error=typeof t==="object"&&!(t instanceof Error)?t:{status:e.status,message:"DASH request error at URL: "+e.uri,response:e.response,code:2};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(t,e,i){const s=t.sidx&&bn(t.sidx);if(!t.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){this.mediaRequest_=o.setTimeout((()=>i(false)),0);return}const n=hl(t.sidx.resolvedUri);const r=(n,r)=>{if(this.requestErrored_(n,r,e)){return}const o=this.mainPlaylistLoader_.sidxMapping_;let a;try{a=wr(te(r.response).subarray(8))}catch(t){this.requestErrored_(t,r,e);return}o[s]={sidxInfo:t.sidx,sidx:a};cn(t,a,t.sidx.resolvedUri);return i(true)};this.request=Hd(n,this.vhs_.xhr,((e,i,s,o)=>{if(e){return r(e,i)}if(!s||s!=="mp4"){return r({status:i.status,message:`Unsupported ${s||"unknown"} container type for sidx segment at URL: ${n}`,response:"",playlist:t,internal:true,playlistExclusionDuration:Infinity,code:2},i)}const{offset:a,length:h}=t.sidx.byterange;if(o.length>=h+a){return r(e,{response:o.subarray(a,a+h),status:i.status,uri:i.uri})}this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",headers:kd({byterange:t.sidx.byterange})},r)}))}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};o.clearTimeout(this.minimumUpdatePeriodTimeout_);o.clearTimeout(this.mediaRequest_);o.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 t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}media(t){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}const e=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 i=!this.media_||t.id!==this.media_.id;if(i&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList){this.state="HAVE_METADATA";this.media_=t;if(i){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!i){return}if(this.media_){this.trigger("mediachanging")}this.addSidxSegments_(t,e,(i=>{this.haveMetadata({startingState:e,playlist:t})}))}haveMetadata({startingState:t,playlist:e}){this.state="HAVE_METADATA";this.loadedPlaylists_[e.id]=e;this.mediaRequest_=null;this.refreshMedia_(e.id);if(t==="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();o.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){o.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(t){o.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const e=this.media();if(t){const t=e?e.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=o.setTimeout((()=>this.load()),t);return}if(!this.started){this.start();return}if(e&&!e.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_=o.setTimeout((()=>this.haveMain_()),0);return}this.requestMain_(((t,e)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}}))}requestMain_(t){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},((e,i)=>{if(this.requestErrored_(e,i)){if(this.state==="HAVE_NOTHING"){this.started=false}return}const s=i.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=i.responseText;if(i.responseHeaders&&i.responseHeaders.date){this.mainLoaded_=Date.parse(i.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=hl(this.mainPlaylistLoader_.srcUrl,i);if(s){this.handleMain_();this.syncClientServerClock_((()=>t(i,s)));return}return t(i,s)}))}syncClientServerClock_(t){const e=pr(this.mainPlaylistLoader_.mainXml_);if(e===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return t()}if(e.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=e.value-Date.now();return t()}this.request=this.vhs_.xhr({uri:al(this.mainPlaylistLoader_.srcUrl,e.value),method:e.method,withCredentials:this.withCredentials},((i,s)=>{if(!this.request){return}if(i){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return t()}let n;if(e.method==="HEAD"){if(!s.responseHeaders||!s.responseHeaders.date){n=this.mainLoaded_}else{n=Date.parse(s.responseHeaders.date)}}else{n=Date.parse(s.responseText)}this.mainPlaylistLoader_.clientOffset_=n-Date.now();t()}))}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 t=this.mainPlaylistLoader_.main;let e=Wd({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:t});if(t){e=Kd(t,e,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=e?e:t;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(i&&i!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=i}if(!t||e&&e.minimumUpdatePeriod!==t.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(e);return Boolean(e)}updateMinimumUpdatePeriodTimeout_(){const t=this.mainPlaylistLoader_;if(t.createMupOnMedia_){t.off("loadedmetadata",t.createMupOnMedia_);t.createMupOnMedia_=null}if(t.minimumUpdatePeriodTimeout_){o.clearTimeout(t.minimumUpdatePeriodTimeout_);t.minimumUpdatePeriodTimeout_=null}let e=t.main&&t.main.minimumUpdatePeriod;if(e===0){if(t.media()){e=t.media().targetDuration*1e3}else{t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_;t.one("loadedmetadata",t.createMupOnMedia_)}}if(typeof e!=="number"||e<=0){if(e<0){this.logger_(`found invalid minimumUpdatePeriod of ${e}, not setting a timeout`)}return}this.createMUPTimeout_(e)}createMUPTimeout_(t){const e=this.mainPlaylistLoader_;e.minimumUpdatePeriodTimeout_=o.setTimeout((()=>{e.minimumUpdatePeriodTimeout_=null;e.trigger("minimumUpdatePeriod");e.createMUPTimeout_(t)}),t)}refreshXml_(){this.requestMain_(((t,e)=>{if(!e){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=Zd(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,(t=>{this.refreshMedia_(this.media().id)}))}))}refreshMedia_(t){if(!t){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const e=this.mainPlaylistLoader_.main.playlists;const i=!this.media_||this.media_!==e[t];if(i){this.media_=e[t]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const t=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=o.setTimeout((()=>{this.trigger("mediaupdatetimeout");t()}),md(this.media(),Boolean(i)))};t()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(t){if(t&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map((t=>({cueTime:t.start,frames:[{data:t.messageData}]})));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}}var ep={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 ip=t=>{const e=new Uint8Array(new ArrayBuffer(t.length));for(let i=0;i<t.length;i++){e[i]=t.charCodeAt(i)}return e.buffer};const sp=function(t){t.on=t.addEventListener;t.off=t.removeEventListener;return t};const np=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 rp=function(t){return function(){const e=np(t);const i=sp(new Worker(e));i.objURL=e;const s=i.terminate;i.on=i.addEventListener;i.off=i.removeEventListener;i.terminate=function(){URL.revokeObjectURL(e);return s.call(this)};return i}};const op=function(t){return`var browserWorkerPolyFill = ${sp.toString()};\n`+"browserWorkerPolyFill(self);\n"+t};const ap=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)};const hp=op(ap((function(){var t=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var e=function(){this.init=function(){var t={};this.on=function(e,i){if(!t[e]){t[e]=[]}t[e]=t[e].concat(i)};this.off=function(e,i){var s;if(!t[e]){return false}s=t[e].indexOf(i);t[e]=t[e].slice();t[e].splice(s,1);return s>-1};this.trigger=function(e){var i,s,n,r;i=t[e];if(!i){return}if(arguments.length===2){n=i.length;for(s=0;s<n;++s){i[s].call(this,arguments[1])}}else{r=[];s=arguments.length;for(s=1;s<arguments.length;++s){r.push(arguments[s])}n=i.length;for(s=0;s<n;++s){i[s].apply(this,r)}}};this.dispose=function(){t={}}}};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(t){this.trigger("data",t)};e.prototype.flush=function(t){this.trigger("done",t)};e.prototype.partialFlush=function(t){this.trigger("partialdone",t)};e.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)};e.prototype.reset=function(t){this.trigger("reset",t)};var i=e;var s=Math.pow(2,32);var n=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);var i;if(e.getBigUint64){i=e.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return e.getUint32(0)*s+e.getUint32(4)};var r={getUint64:n,MAX_UINT32:s};var o=r.MAX_UINT32;var a,h,u,c,f,l,d,p,m,v,g,y,b,w,T,S,k,E,I,x,A,D,C,j,_,N,M,O,L,R,$,P,U,F,B,q;(function(){var t;C={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(t in C){if(C.hasOwnProperty(t)){C[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]}}j=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);N=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);_=new Uint8Array([0,0,0,1]);M=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]);O=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]);L={video:M,audio:O};P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);$=new Uint8Array([0,0,0,0,0,0,0,0]);U=new Uint8Array([0,0,0,0,0,0,0,0]);F=U;B=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);q=U;R=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();a=function(t){var e=[],i=0,s,n,r;for(s=1;s<arguments.length;s++){e.push(arguments[s])}s=e.length;while(s--){i+=e[s].byteLength}n=new Uint8Array(i+8);r=new DataView(n.buffer,n.byteOffset,n.byteLength);r.setUint32(0,n.byteLength);n.set(t,4);for(s=0,i=8;s<e.length;s++){n.set(e[s],i);i+=e[s].byteLength}return n};h=function(){return a(C.dinf,a(C.dref,P))};u=function(t){return a(C.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,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))};c=function(){return a(C.ftyp,j,_,j,N)};S=function(t){return a(C.hdlr,L[t])};f=function(t){return a(C.mdat,t)};T=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,t.duration&255,85,196,0,0]);if(t.samplerate){e[12]=t.samplerate>>>24&255;e[13]=t.samplerate>>>16&255;e[14]=t.samplerate>>>8&255;e[15]=t.samplerate&255}return a(C.mdhd,e)};w=function(t){return a(C.mdia,T(t),S(t.type),d(t))};l=function(t){return a(C.mfhd,new Uint8Array([0,0,0,0,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255]))};d=function(t){return a(C.minf,t.type==="video"?a(C.vmhd,R):a(C.smhd,$),h(),E(t))};p=function(t,e){var i=[],s=e.length;while(s--){i[s]=x(e[s])}return a.apply(null,[C.moof,l(t)].concat(i))};m=function(t){var e=t.length,i=[];while(e--){i[e]=y(t[e])}return a.apply(null,[C.moov,g(4294967295)].concat(i).concat(v(t)))};v=function(t){var e=t.length,i=[];while(e--){i[e]=A(t[e])}return a.apply(null,[C.mvex].concat(i))};g=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&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 a(C.mvhd,e)};k=function(t){var e=t.samples||[],i=new Uint8Array(4+e.length),s,n;for(n=0;n<e.length;n++){s=e[n].flags;i[n+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return a(C.sdtp,i)};E=function(t){return a(C.stbl,I(t),a(C.stts,q),a(C.stsc,F),a(C.stsz,B),a(C.stco,U))};(function(){var t,e;I=function(i){return a(C.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),i.type==="video"?t(i):e(i))};t=function(t){var e=t.sps||[],i=t.pps||[],s=[],n=[],r,o;for(r=0;r<e.length;r++){s.push((e[r].byteLength&65280)>>>8);s.push(e[r].byteLength&255);s=s.concat(Array.prototype.slice.call(e[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]))}o=[C.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,(t.width&65280)>>8,t.width&255,(t.height&65280)>>8,t.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]),a(C.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([e.length],s,[i.length],n))),a(C.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(t.sarRatio){var h=t.sarRatio[0],u=t.sarRatio[1];o.push(a(C.pasp,new Uint8Array([(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255])))}return a.apply(null,o)};e=function(t){return a(C.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(t.channelcount&65280)>>8,t.channelcount&255,(t.samplesize&65280)>>8,t.samplesize&255,0,0,0,0,(t.samplerate&65280)>>8,t.samplerate&255,0,0]),u(t))}})();b=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,0,(t.duration&4278190080)>>24,(t.duration&16711680)>>16,(t.duration&65280)>>8,t.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,(t.width&65280)>>8,t.width&255,0,0,(t.height&65280)>>8,t.height&255,0,0]);return a(C.tkhd,e)};x=function(t){var e,i,s,n,r,h,u;e=a(C.tfhd,new Uint8Array([0,0,0,58,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));h=Math.floor(t.baseMediaDecodeTime/o);u=Math.floor(t.baseMediaDecodeTime%o);i=a(C.tfdt,new Uint8Array([1,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255]));r=32+20+8+16+8+8;if(t.type==="audio"){s=D(t,r);return a(C.traf,e,i,s)}n=k(t);s=D(t,n.length+r);return a(C.traf,e,i,s,n)};y=function(t){t.duration=t.duration||4294967295;return a(C.trak,b(t),w(t))};A=function(t){var e=new Uint8Array([0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(t.type!=="video"){e[e.length-1]=0}return a(C.trex,e)};(function(){var t,e,i;i=function(t,e){var i=0,s=0,n=0,r=0;if(t.length){if(t[0].duration!==undefined){i=1}if(t[0].size!==undefined){s=2}if(t[0].flags!==undefined){n=4}if(t[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|s|n|r,1,(t.length&4278190080)>>>24,(t.length&16711680)>>>16,(t.length&65280)>>>8,t.length&255,(e&4278190080)>>>24,(e&16711680)>>>16,(e&65280)>>>8,e&255]};e=function(t,e){var s,n,r,o,h,u;o=t.samples||[];e+=8+12+16*o.length;r=i(o,e);n=new Uint8Array(r.length+o.length*16);n.set(r);s=r.length;for(u=0;u<o.length;u++){h=o[u];n[s++]=(h.duration&4278190080)>>>24;n[s++]=(h.duration&16711680)>>>16;n[s++]=(h.duration&65280)>>>8;n[s++]=h.duration&255;n[s++]=(h.size&4278190080)>>>24;n[s++]=(h.size&16711680)>>>16;n[s++]=(h.size&65280)>>>8;n[s++]=h.size&255;n[s++]=h.flags.isLeading<<2|h.flags.dependsOn;n[s++]=h.flags.isDependedOn<<6|h.flags.hasRedundancy<<4|h.flags.paddingValue<<1|h.flags.isNonSyncSample;n[s++]=h.flags.degradationPriority&240<<8;n[s++]=h.flags.degradationPriority&15;n[s++]=(h.compositionTimeOffset&4278190080)>>>24;n[s++]=(h.compositionTimeOffset&16711680)>>>16;n[s++]=(h.compositionTimeOffset&65280)>>>8;n[s++]=h.compositionTimeOffset&255}return a(C.trun,n)};t=function(t,e){var s,n,r,o,h,u;o=t.samples||[];e+=8+12+8*o.length;r=i(o,e);s=new Uint8Array(r.length+o.length*8);s.set(r);n=r.length;for(u=0;u<o.length;u++){h=o[u];s[n++]=(h.duration&4278190080)>>>24;s[n++]=(h.duration&16711680)>>>16;s[n++]=(h.duration&65280)>>>8;s[n++]=h.duration&255;s[n++]=(h.size&4278190080)>>>24;s[n++]=(h.size&16711680)>>>16;s[n++]=(h.size&65280)>>>8;s[n++]=h.size&255}return a(C.trun,s)};D=function(i,s){if(i.type==="audio"){return t(i,s)}return e(i,s)}})();var V={ftyp:c,mdat:f,moof:p,moov:m,initSegment:function(t){var e=c(),i=m(t),s;s=new Uint8Array(e.byteLength+i.byteLength);s.set(e);s.set(i,e.byteLength);return s}};var H=function(t){var e,i,s=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;s.byteLength=0;for(e=0;e<t.length;e++){i=t[e];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 z=function(t){var e,i,s=[],n=[];s.byteLength=0;s.nalCount=0;s.duration=0;s.pts=t[0].pts;s.dts=t[0].dts;n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=t[0].pts;n.dts=t[0].dts;for(e=0;e<t.length;e++){i=t[e];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 X=function(t){var e;if(!t[0][0].keyFrame&&t.length>1){e=t.shift();t.byteLength-=e.byteLength;t.nalCount-=e.nalCount;t[0][0].dts=e.dts;t[0][0].pts=e.pts;t[0][0].duration+=e.duration}return t};var G=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var W=function(t,e){var i=G();i.dataOffset=e;i.compositionTimeOffset=t.pts-t.dts;i.duration=t.duration;i.size=4*t.length;i.size+=t.byteLength;if(t.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var Y=function(t,e){var i,s,n,r,o,a=e||0,h=[];for(i=0;i<t.length;i++){r=t[i];for(s=0;s<r.length;s++){o=r[s];n=W(o,a);a+=n.size;h.push(n)}}return h};var K=function(t){var e,i,s,n,r,o,a=0,h=t.byteLength,u=t.nalCount,c=h+4*u,f=new Uint8Array(c),l=new DataView(f.buffer);for(e=0;e<t.length;e++){n=t[e];for(i=0;i<n.length;i++){r=n[i];for(s=0;s<r.length;s++){o=r[s];l.setUint32(a,o.data.byteLength);a+=4;f.set(o.data,a);a+=o.data.byteLength}}}return f};var Q=function(t,e){var i,s=e||0,n=[];i=W(t,s);n.push(i);return n};var J=function(t){var e,i,s=0,n=t.byteLength,r=t.length,o=n+4*r,a=new Uint8Array(o),h=new DataView(a.buffer);for(e=0;e<t.length;e++){i=t[e];h.setUint32(s,i.data.byteLength);s+=4;a.set(i.data,s);s+=i.data.byteLength}return a};var Z={groupNalsIntoFrames:H,groupFramesIntoGops:z,extendFirstKeyFrame:X,generateSampleTable:Y,concatenateNalData:K,generateSampleTableForFrame:Q,concatenateNalDataForFrame:J};var tt=[33,16,5,32,164,27];var et=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var it=function(t){var e=[];while(t--){e.push(0)}return e};var st=function(t){return Object.keys(t).reduce((function(e,i){e[i]=new Uint8Array(t[i].reduce((function(t,e){return t.concat(e)}),[]));return e}),{})};var nt;var rt=function(){if(!nt){var t={96e3:[tt,[227,64],it(154),[56]],88200:[tt,[231],it(170),[56]],64e3:[tt,[248,192],it(240),[56]],48e3:[tt,[255,192],it(268),[55,148,128],it(54),[112]],44100:[tt,[255,192],it(268),[55,163,128],it(84),[112]],32e3:[tt,[255,192],it(268),[55,234],it(226),[112]],24e3:[tt,[255,192],it(268),[55,255,128],it(268),[111,112],it(126),[224]],16e3:[tt,[255,192],it(268),[55,255,128],it(268),[111,255],it(269),[223,108],it(195),[1,192]],12e3:[et,it(268),[3,127,248],it(268),[6,255,240],it(268),[13,255,224],it(268),[27,253,128],it(259),[56]],11025:[et,it(268),[3,127,248],it(268),[6,255,240],it(268),[13,255,224],it(268),[27,255,192],it(268),[55,175,128],it(108),[112]],8e3:[et,it(268),[3,121,16],it(47),[7]]};nt=st(t)}return nt};var ot=9e4,at,ht,ut,ct,ft,lt,dt;at=function(t){return t*ot};ht=function(t,e){return t*e};ut=function(t){return t/ot};ct=function(t,e){return t/e};ft=function(t,e){return at(ct(t,e))};lt=function(t,e){return ht(ut(t),e)};dt=function(t,e,i){return ut(i?t:t-e)};var pt={ONE_SECOND_IN_TS:ot,secondsToVideoTs:at,secondsToAudioTs:ht,videoTsToSeconds:ut,audioTsToSeconds:ct,audioTsToVideoTs:ft,videoTsToAudioTs:lt,metadataTsToSeconds:dt};var mt=rt;var vt=pt;var gt=function(t){var e,i,s=0;for(e=0;e<t.length;e++){i=t[e];s+=i.data.byteLength}return s};var yt=function(t,e,i,s){var n,r=0,o=0,a=0,h=0,u,c,f;if(!e.length){return}n=vt.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate);r=Math.ceil(vt.ONE_SECOND_IN_TS/(t.samplerate/1024));if(i&&s){o=n-Math.max(i,s);a=Math.floor(o/r);h=a*r}if(a<1||h>vt.ONE_SECOND_IN_TS/2){return}u=mt()[t.samplerate];if(!u){u=e[0].data}for(c=0;c<a;c++){f=e[0];e.splice(0,0,{data:u,dts:f.dts-r,pts:f.pts-r})}t.baseMediaDecodeTime-=Math.floor(vt.videoTsToAudioTs(h,t.samplerate));return h};var bt=function(t,e,i){if(e.minSegmentDts>=i){return t}e.minSegmentDts=Infinity;return t.filter((function(t){if(t.dts>=i){e.minSegmentDts=Math.min(e.minSegmentDts,t.dts);e.minSegmentPts=e.minSegmentDts;return true}return false}))};var wt=function(t){var e,i,s=[];for(e=0;e<t.length;e++){i=t[e];s.push({size:i.data.byteLength,duration:1024})}return s};var Tt=function(t){var e,i,s=0,n=new Uint8Array(gt(t));for(e=0;e<t.length;e++){i=t[e];n.set(i.data,s);s+=i.data.byteLength}return n};var St={prefixWithSilence:yt,trimAdtsFramesByEarliestDts:bt,generateSampleTable:wt,concatenateFrameData:Tt};var kt=pt.ONE_SECOND_IN_TS;var Et=function(t,e){if(typeof e.pts==="number"){if(t.timelineStartInfo.pts===undefined){t.timelineStartInfo.pts=e.pts}if(t.minSegmentPts===undefined){t.minSegmentPts=e.pts}else{t.minSegmentPts=Math.min(t.minSegmentPts,e.pts)}if(t.maxSegmentPts===undefined){t.maxSegmentPts=e.pts}else{t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)}}if(typeof e.dts==="number"){if(t.timelineStartInfo.dts===undefined){t.timelineStartInfo.dts=e.dts}if(t.minSegmentDts===undefined){t.minSegmentDts=e.dts}else{t.minSegmentDts=Math.min(t.minSegmentDts,e.dts)}if(t.maxSegmentDts===undefined){t.maxSegmentDts=e.dts}else{t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts)}}};var It=function(t){delete t.minSegmentDts;delete t.maxSegmentDts;delete t.minSegmentPts;delete t.maxSegmentPts};var xt=function(t,e){var i,s,n=t.minSegmentDts;if(!e){n-=t.timelineStartInfo.dts}i=t.timelineStartInfo.baseMediaDecodeTime;i+=n;i=Math.max(0,i);if(t.type==="audio"){s=t.samplerate/kt;i*=s;i=Math.floor(i)}return i};var At={clearDtsInfo:It,calculateTrackBaseMediaDecodeTime:xt,collectDtsInfo:Et};var Dt=4,Ct=128;var jt=function(t){var e=0,i={payloadType:-1,payloadSize:0},s=0,n=0;while(e<t.byteLength){if(t[e]===Ct){break}while(t[e]===255){s+=255;e++}s+=t[e++];while(t[e]===255){n+=255;e++}n+=t[e++];if(!i.payload&&s===Dt){var r=String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6]);if(r==="GA94"){i.payloadType=s;i.payloadSize=n;i.payload=t.subarray(e,e+n);break}else{i.payload=void 0}}e+=n;s=0;n=0}return i};var _t=function(t){if(t.payload[0]!==181){return null}if((t.payload[1]<<8|t.payload[2])!==49){return null}if(String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"){return null}if(t.payload[7]!==3){return null}return t.payload.subarray(8,t.payload.length-1)};var Nt=function(t,e){var i=[],s,n,r,o;if(!(e[0]&64)){return i}n=e[0]&31;for(s=0;s<n;s++){r=s*3;o={type:e[r+2]&3,pts:t};if(e[r+2]&4){o.ccData=e[r+3]<<8|e[r+4];i.push(o)}}return i};var Mt=function(t){var e=t.byteLength,i=[],s=1,n,r;while(s<e-2){if(t[s]===0&&t[s+1]===0&&t[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return t}n=e-i.length;r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=t[o]}return r};var Ot={parseSei:jt,parseUserData:_t,parseCaptionPackets:Nt,discardEmulationPreventionBytes:Mt,USER_DATA_REGISTERED_ITU_T_T35:Dt};var Lt=i;var Rt=Ot;var $t=function(t){t=t||{};$t.prototype.init.call(this);this.parse708captions_=typeof t.parse708captions==="boolean"?t.parse708captions:true;this.captionPackets_=[];this.ccStreams_=[new Yt(0,0),new Yt(0,1),new Yt(1,0),new Yt(1,1)];if(this.parse708captions_){this.cc708Stream_=new Vt({captionServices:t.captionServices})}this.reset();this.ccStreams_.forEach((function(t){t.on("data",this.trigger.bind(this,"data"));t.on("partialdone",this.trigger.bind(this,"partialdone"));t.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"))}};$t.prototype=new Lt;$t.prototype.push=function(t){var e,i,s;if(t.nalUnitType!=="sei_rbsp"){return}e=Rt.parseSei(t.escapedRBSP);if(!e.payload){return}if(e.payloadType!==Rt.USER_DATA_REGISTERED_ITU_T_T35){return}i=Rt.parseUserData(e);if(!i){return}if(t.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}s=Rt.parseCaptionPackets(t.pts,i);this.captionPackets_=this.captionPackets_.concat(s);if(this.latestDts_!==t.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=t.dts};$t.prototype.flushCCStreams=function(t){this.ccStreams_.forEach((function(e){return t==="flush"?e.flush():e.partialFlush()}),this)};$t.prototype.flushStream=function(t){if(!this.captionPackets_.length){this.flushCCStreams(t);return}this.captionPackets_.forEach((function(t,e){t.presortIndex=e}));this.captionPackets_.sort((function(t,e){if(t.pts===e.pts){return t.presortIndex-e.presortIndex}return t.pts-e.pts}));this.captionPackets_.forEach((function(t){if(t.type<2){this.dispatchCea608Packet(t)}else{this.dispatchCea708Packet(t)}}),this);this.captionPackets_.length=0;this.flushCCStreams(t)};$t.prototype.flush=function(){return this.flushStream("flush")};$t.prototype.partialFlush=function(){return this.flushStream("partialFlush")};$t.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach((function(t){t.reset()}))};$t.prototype.dispatchCea608Packet=function(t){if(this.setsTextOrXDSActive(t)){this.activeCea608Channel_[t.type]=null}else if(this.setsChannel1Active(t)){this.activeCea608Channel_[t.type]=0}else if(this.setsChannel2Active(t)){this.activeCea608Channel_[t.type]=1}if(this.activeCea608Channel_[t.type]===null){return}this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)};$t.prototype.setsChannel1Active=function(t){return(t.ccData&30720)===4096};$t.prototype.setsChannel2Active=function(t){return(t.ccData&30720)===6144};$t.prototype.setsTextOrXDSActive=function(t){return(t.ccData&28928)===256||(t.ccData&30974)===4138||(t.ccData&30974)===6186};$t.prototype.dispatchCea708Packet=function(t){if(this.parse708captions_){this.cc708Stream_.push(t)}};var Pt={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 Ut=function(t){var e=Pt[t]||t;if(t&4096&&t===e){return""}return String.fromCharCode(e)};var Ft=function(t){return 32<=t&&t<=127||160<=t&&t<=255};var Bt=function(t){this.windowNum=t;this.reset()};Bt.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};Bt.prototype.getText=function(){return this.rows.join("\n")};Bt.prototype.clearText=function(){this.rows=[""];this.rowIdx=0};Bt.prototype.newLine=function(t){if(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(t)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};Bt.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};Bt.prototype.addText=function(t){this.rows[this.rowIdx]+=t};Bt.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1)}};var qt=function(t,e,i){this.serviceNum=t;this.text="";this.currentWindow=new Bt(-1);this.windows=[];this.stream=i;if(typeof e==="string"){this.createTextDecoder(e)}};qt.prototype.init=function(t,e){this.startPts=t;for(var i=0;i<8;i++){this.windows[i]=new Bt(i);if(typeof e==="function"){this.windows[i].beforeRowOverflow=e}}};qt.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t]};qt.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 Vt=function(t){t=t||{};Vt.prototype.init.call(this);var e=this;var i=t.captionServices||{};var s={};var n;Object.keys(i).forEach((t=>{n=i[t];if(/^SERVICE/.test(t)){s[t]=n.encoding}}));this.serviceEncodings=s;this.current708Packet=null;this.services={};this.push=function(t){if(t.type===3){e.new708Packet();e.add708Bytes(t)}else{if(e.current708Packet===null){e.new708Packet()}e.add708Bytes(t)}}};Vt.prototype=new Lt;Vt.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};Vt.prototype.add708Bytes=function(t){var e=t.ccData;var i=e>>>8;var s=e&255;this.current708Packet.ptsVals.push(t.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(s)};Vt.prototype.push708Packet=function(){var t=this.current708Packet;var e=t.data;var i=null;var s=null;var n=0;var r=e[n++];t.seq=r>>6;t.sizeCode=r&63;for(;n<e.length;n++){r=e[n++];i=r>>5;s=r&31;if(i===7&&s>0){r=e[n++];i=r}this.pushServiceBlock(i,n,s);if(s>0){n+=s-1}}};Vt.prototype.pushServiceBlock=function(t,e,i){var s;var n=e;var r=this.current708Packet.data;var o=this.services[t];if(!o){o=this.initService(t,n)}for(;n<e+i&&n<r.length;n++){s=r[n];if(Ft(s)){n=this.handleText(n,o)}else if(s===24){n=this.multiByteCharacter(n,o)}else if(s===16){n=this.extendedCommands(n,o)}else if(128<=s&&s<=135){n=this.setCurrentWindow(n,o)}else if(152<=s&&s<=159){n=this.defineWindow(n,o)}else if(s===136){n=this.clearWindows(n,o)}else if(s===140){n=this.deleteWindows(n,o)}else if(s===137){n=this.displayWindows(n,o)}else if(s===138){n=this.hideWindows(n,o)}else if(s===139){n=this.toggleWindows(n,o)}else if(s===151){n=this.setWindowAttributes(n,o)}else if(s===144){n=this.setPenAttributes(n,o)}else if(s===145){n=this.setPenColor(n,o)}else if(s===146){n=this.setPenLocation(n,o)}else if(s===143){o=this.reset(n,o)}else if(s===8){o.currentWindow.backspace()}else if(s===12){o.currentWindow.clearText()}else if(s===13){o.currentWindow.pendingNewLine=true}else if(s===14){o.currentWindow.clearText()}else if(s===141){n++}else;}};Vt.prototype.extendedCommands=function(t,e){var i=this.current708Packet.data;var s=i[++t];if(Ft(s)){t=this.handleText(t,e,{isExtended:true})}return t};Vt.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]};Vt.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 qt(t,n,s);this.services[t].init(this.getPts(e),(function(e){s.flushDisplayed(e,s.services[t])}));return this.services[t]};Vt.prototype.handleText=function(t,e,i){var s=i&&i.isExtended;var n=i&&i.isMultiByte;var r=this.current708Packet.data;var o=s?4096:0;var a=r[t];var h=r[t+1];var u=e.currentWindow;var c;var f;if(e.textDecoder_&&!s){if(n){f=[a,h];t++}else{f=[a]}c=e.textDecoder_.decode(new Uint8Array(f))}else{c=Ut(o|a)}if(u.pendingNewLine&&!u.isEmpty()){u.newLine(this.getPts(t))}u.pendingNewLine=false;u.addText(c);return t};Vt.prototype.multiByteCharacter=function(t,e){var i=this.current708Packet.data;var s=i[t+1];var n=i[t+2];if(Ft(s)&&Ft(n)){t=this.handleText(++t,e,{isMultiByte:true})}return t};Vt.prototype.setCurrentWindow=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=s&7;e.setCurrentWindow(n);return t};Vt.prototype.defineWindow=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=s&7;e.setCurrentWindow(n);var r=e.currentWindow;s=i[++t];r.visible=(s&32)>>5;r.rowLock=(s&16)>>4;r.columnLock=(s&8)>>3;r.priority=s&7;s=i[++t];r.relativePositioning=(s&128)>>7;r.anchorVertical=s&127;s=i[++t];r.anchorHorizontal=s;s=i[++t];r.anchorPoint=(s&240)>>4;r.rowCount=s&15;s=i[++t];r.columnCount=s&63;s=i[++t];r.windowStyle=(s&56)>>3;r.penStyle=s&7;r.virtualRowCount=r.rowCount+1;return t};Vt.prototype.setWindowAttributes=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.winAttr;s=i[++t];n.fillOpacity=(s&192)>>6;n.fillRed=(s&48)>>4;n.fillGreen=(s&12)>>2;n.fillBlue=s&3;s=i[++t];n.borderType=(s&192)>>6;n.borderRed=(s&48)>>4;n.borderGreen=(s&12)>>2;n.borderBlue=s&3;s=i[++t];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[++t];n.effectSpeed=(s&240)>>4;n.effectDirection=(s&12)>>2;n.displayEffect=s&3;return t};Vt.prototype.flushDisplayed=function(t,e){var i=[];for(var s=0;s<8;s++){if(e.windows[s].visible&&!e.windows[s].isEmpty()){i.push(e.windows[s].getText())}}e.endPts=t;e.text=i.join("\n\n");this.pushCaption(e);e.startPts=t};Vt.prototype.pushCaption=function(t){if(t.text!==""){this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum});t.text="";t.startPts=t.endPts}};Vt.prototype.displayWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible=1}}return t};Vt.prototype.hideWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible=0}}return t};Vt.prototype.toggleWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible^=1}}return t};Vt.prototype.clearWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].clearText()}}return t};Vt.prototype.deleteWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].reset()}}return t};Vt.prototype.setPenAttributes=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penAttr;s=i[++t];n.textTag=(s&240)>>4;n.offset=(s&12)>>2;n.penSize=s&3;s=i[++t];n.italics=(s&128)>>7;n.underline=(s&64)>>6;n.edgeType=(s&56)>>3;n.fontStyle=s&7;return t};Vt.prototype.setPenColor=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penColor;s=i[++t];n.fgOpacity=(s&192)>>6;n.fgRed=(s&48)>>4;n.fgGreen=(s&12)>>2;n.fgBlue=s&3;s=i[++t];n.bgOpacity=(s&192)>>6;n.bgRed=(s&48)>>4;n.bgGreen=(s&12)>>2;n.bgBlue=s&3;s=i[++t];n.edgeRed=(s&48)>>4;n.edgeGreen=(s&12)>>2;n.edgeBlue=s&3;return t};Vt.prototype.setPenLocation=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penLoc;e.currentWindow.pendingNewLine=true;s=i[++t];n.row=s&15;s=i[++t];n.column=s&63;return t};Vt.prototype.reset=function(t,e){var i=this.getPts(t);this.flushDisplayed(i,e);return this.initService(e.serviceNum,t)};var Ht={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 zt=function(t){if(t===null){return""}t=Ht[t]||t;return String.fromCharCode(t)};var Xt=14;var Gt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var Wt=function(){var t=[],e=Xt+1;while(e--){t.push({text:"",indent:0,offset:0})}return t};var Yt=function(t,e){Yt.prototype.init.call(this);this.field_=t||0;this.dataChannel_=e||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(t){var e,i,s,n,r;e=t.ccData&32639;if(e===this.lastControlCode_){this.lastControlCode_=null;return}if((e&61440)===4096){this.lastControlCode_=e}else if(e!==this.PADDING_){this.lastControlCode_=null}s=e>>>8;n=e&255;if(e===this.PADDING_){return}else if(e===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(e===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(t.pts);this.flushDisplayed(t.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=t.pts}else if(e===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(t.pts)}else if(e===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(t.pts)}else if(e===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(t.pts)}else if(e===this.CARRIAGE_RETURN_){this.clearFormatting(t.pts);this.flushDisplayed(t.pts);this.shiftRowsUp_();this.startPts_=t.pts}else if(e===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(e===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(t.pts);this.displayed_=Wt()}else if(e===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=Wt()}else if(e===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(t.pts);this.displayed_=Wt()}this.mode_="paintOn";this.startPts_=t.pts}else if(this.isSpecialCharacter(s,n)){s=(s&3)<<8;r=zt(s|n);this[this.mode_](t.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=zt(s|n);this[this.mode_](t.pts,r);this.column_++}else if(this.isMidRowCode(s,n)){this.clearFormatting(t.pts);this[this.mode_](t.pts," ");this.column_++;if((n&14)===14){this.addFormatting(t.pts,["i"])}if((n&1)===1){this.addFormatting(t.pts,["u"])}}else if(this.isOffsetControlCode(s,n)){const t=n&3;this.nonDisplayed_[this.row_].offset=t;this.column_+=t}else if(this.isPAC(s,n)){var o=Gt.indexOf(e&7968);if(this.mode_==="rollUp"){if(o-this.rollUpRows_+1<0){o=this.rollUpRows_-1}this.setRollUp(t.pts,o)}if(o!==this.row_){this.clearFormatting(t.pts);this.row_=o}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(t.pts,["u"])}if((e&16)===16){const t=(e&14)>>1;this.column_=t*4;this.nonDisplayed_[this.row_].indent+=t}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(t.pts,["i"])}}}else if(this.isNormalChar(s)){if(n===0){n=null}r=zt(s);r+=zt(n);this[this.mode_](t.pts,r);this.column_+=r.length}}};Yt.prototype=new Lt;Yt.prototype.flushDisplayed=function(t){const e=t=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."})};const i=[];this.displayed_.forEach(((t,s)=>{if(t&&t.text&&t.text.length){try{t.text=t.text.trim()}catch(t){e(s)}if(t.text.length){i.push({text:t.text,line:s+1,position:10+Math.min(70,t.indent*10)+t.offset*2.5})}}else if(t===undefined||t===null){e(s)}}));if(i.length){this.trigger("data",{startPts:this.startPts_,endPts:t,content:i,stream:this.name_})}};Yt.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=Wt();this.nonDisplayed_=Wt();this.lastControlCode_=null;this.column_=0;this.row_=Xt;this.rollUpRows_=2;this.formatting_=[]};Yt.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};Yt.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63};Yt.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63};Yt.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47};Yt.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35};Yt.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127};Yt.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127};Yt.prototype.isNormalChar=function(t){return t>=32&&t<=127};Yt.prototype.setRollUp=function(t,e){if(this.mode_!=="rollUp"){this.row_=Xt;this.mode_="rollUp";this.flushDisplayed(t);this.nonDisplayed_=Wt();this.displayed_=Wt()}if(e!==undefined&&e!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[e-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]={text:"",indent:0,offset:0}}}if(e===undefined){e=this.row_}this.topRow_=e-this.rollUpRows_+1};Yt.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce((function(t,e){return t+"<"+e+">"}),"");this[this.mode_](t,i)};Yt.prototype.clearFormatting=function(t){if(!this.formatting_.length){return}var e=this.formatting_.reverse().reduce((function(t,e){return t+"</"+e+">"}),"");this.formatting_=[];this[this.mode_](t,e)};Yt.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_].text;i+=e;this.nonDisplayed_[this.row_].text=i};Yt.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_].text;i+=e;this.displayed_[this.row_].text=i};Yt.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++){this.displayed_[t]={text:"",indent:0,offset:0}}for(t=this.row_+1;t<Xt+1;t++){this.displayed_[t]={text:"",indent:0,offset:0}}for(t=this.topRow_;t<this.row_;t++){this.displayed_[t]=this.displayed_[t+1]}this.displayed_[this.row_]={text:"",indent:0,offset:0}};Yt.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_].text;i+=e;this.displayed_[this.row_].text=i};var Kt={CaptionStream:$t,Cea608Stream:Yt,Cea708Stream:Vt};var Qt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var Jt=i;var Zt=8589934592;var te=4294967296;var ee="shared";var ie=function(t,e){var i=1;if(t>e){i=-1}while(Math.abs(e-t)>te){t+=i*Zt}return t};var se=function(t){var e,i;se.prototype.init.call(this);this.type_=t||ee;this.push=function(t){if(this.type_!==ee&&t.type!==this.type_){return}if(i===undefined){i=t.dts}t.dts=ie(t.dts,i);t.pts=ie(t.pts,i);e=t.dts;this.trigger("data",t)};this.flush=function(){i=e;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){i=void 0;e=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};se.prototype=new Jt;var ne={TimestampRolloverStream:se,handleRollover:ie};var re=(t,e,i)=>{if(!t){return-1}var s=i;for(;s<t.length;s++){if(t[s]===e){return s}}return-1};var oe={typedArrayIndexOf:re};var ae=oe.typedArrayIndexOf,he={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},ue=function(t,e,i){var s,n="";for(s=e;s<i;s++){n+="%"+("00"+t[s].toString(16)).slice(-2)}return n},ce=function(t,e,i){return decodeURIComponent(ue(t,e,i))},fe=function(t,e,i){return unescape(ue(t,e,i))},le=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},de={APIC:function(t){var e=1,i,s,n="--\x3e";if(t.data[0]!==he.Utf8){return}i=ae(t.data,0,e);if(i<0){return}t.mimeType=fe(t.data,e,i);e=i+1;t.pictureType=t.data[e];e++;s=ae(t.data,0,e);if(s<0){return}t.description=ce(t.data,e,s);e=s+1;if(t.mimeType===n){t.url=fe(t.data,e,t.data.length)}else{t.pictureData=t.data.subarray(e,t.data.length)}},"T*":function(t){if(t.data[0]!==he.Utf8){return}t.value=ce(t.data,1,t.data.length).replace(/\0*$/,"");t.values=t.value.split("\0")},TXXX:function(t){var e;if(t.data[0]!==he.Utf8){return}e=ae(t.data,0,1);if(e===-1){return}t.description=ce(t.data,1,e);t.value=ce(t.data,e+1,t.data.length).replace(/\0*$/,"");t.data=t.value},"W*":function(t){t.url=fe(t.data,0,t.data.length).replace(/\0.*$/,"")},WXXX:function(t){var e;if(t.data[0]!==he.Utf8){return}e=ae(t.data,0,1);if(e===-1){return}t.description=ce(t.data,1,e);t.url=fe(t.data,e+1,t.data.length).replace(/\0.*$/,"")},PRIV:function(t){var e;for(e=0;e<t.data.length;e++){if(t.data[e]===0){t.owner=fe(t.data,0,e);break}}t.privateData=t.data.subarray(e+1);t.data=t.privateData}};var pe=function(t){var e,i,s=10,n=0,r=[];if(t.length<10||t[0]!=="I".charCodeAt(0)||t[1]!=="D".charCodeAt(0)||t[2]!=="3".charCodeAt(0)){return}n=le(t.subarray(6,10));n+=10;var o=t[5]&64;if(o){s+=4;s+=le(t.subarray(10,14));n-=le(t.subarray(16,20))}do{e=le(t.subarray(s+4,s+8));if(e<1){break}i=String.fromCharCode(t[s],t[s+1],t[s+2],t[s+3]);var a={id:i,data:t.subarray(s+10,s+e+10)};a.key=a.id;if(de[a.id]){de[a.id](a)}else if(a.id[0]==="T"){de["T*"](a)}else if(a.id[0]==="W"){de["W*"](a)}r.push(a);s+=10;s+=e}while(s<n);return r};var me={parseId3Frames:pe,parseSyncSafeInteger:le,frameParsers:de};var ve=i,ge=Qt,ye=me,be;be=function(t){var e={descriptor:t&&t.descriptor},i=0,s=[],n=0,r;be.prototype.init.call(this);this.dispatchType=ge.METADATA_STREAM_TYPE.toString(16);if(e.descriptor){for(r=0;r<e.descriptor.length;r++){this.dispatchType+=("00"+e.descriptor[r].toString(16)).slice(-2)}}this.push=function(t){var e,r,o,a,h,u;if(t.type!=="timed-metadata"){return}if(t.dataAlignmentIndicator){n=0;s.length=0}if(s.length===0&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}s.push(t);n+=t.data.byteLength;if(s.length===1){i=ye.parseSyncSafeInteger(t.data.subarray(6,10));i+=10}if(n<i){return}e={data:new Uint8Array(i),frames:[],pts:s[0].pts,dts:s[0].dts};for(h=0;h<i;){e.data.set(s[0].data.subarray(0,i-h),h);h+=s[0].data.byteLength;n-=s[0].data.byteLength;s.shift()}r=10;if(e.data[5]&64){r+=4;r+=ye.parseSyncSafeInteger(e.data.subarray(10,14));i-=ye.parseSyncSafeInteger(e.data.subarray(16,20))}do{o=ye.parseSyncSafeInteger(e.data.subarray(r+4,r+8));if(o<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}u=String.fromCharCode(e.data[r],e.data[r+1],e.data[r+2],e.data[r+3]);a={id:u,data:e.data.subarray(r+10,r+o+10)};a.key=a.id;if(ye.frameParsers[a.id]){ye.frameParsers[a.id](a)}else if(a.id[0]==="T"){ye.frameParsers["T*"](a)}else if(a.id[0]==="W"){ye.frameParsers["W*"](a)}if(a.owner==="com.apple.streaming.transportStreamTimestamp"){var c=a.data,f=(c[3]&1)<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;f*=4;f+=c[7]&3;a.timeStamp=f;if(e.pts===undefined&&e.dts===undefined){e.pts=a.timeStamp;e.dts=a.timeStamp}this.trigger("timestamp",a)}e.frames.push(a);r+=10;r+=o}while(r<i);this.trigger("data",e)}};be.prototype=new ve;var we=be;var Te=i,Se=Kt,ke=Qt,Ee=ne.TimestampRolloverStream;var Ie,xe,Ae;var De=188,Ce=71;Ie=function(){var t=new Uint8Array(De),e=0;Ie.prototype.init.call(this);this.push=function(i){var s=0,n=De,r;if(e){r=new Uint8Array(i.byteLength+e);r.set(t.subarray(0,e));r.set(i,e);e=0}else{r=i}while(n<r.byteLength){if(r[s]===Ce&&r[n]===Ce){this.trigger("data",r.subarray(s,n));s+=De;n+=De;continue}s++;n++}if(s<r.byteLength){t.set(r.subarray(s),0);e=r.byteLength-s}};this.flush=function(){if(e===De&&t[0]===Ce){this.trigger("data",t);e=0}this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.reset=function(){e=0;this.trigger("reset")}};Ie.prototype=new Te;xe=function(){var t,e,i,s;xe.prototype.init.call(this);s=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;t=function(t,s){var n=0;if(s.payloadUnitStartIndicator){n+=t[n]+1}if(s.type==="pat"){e(t.subarray(n),s)}else{i(t.subarray(n),s)}};e=function(t,e){e.section_number=t[7];e.last_section_number=t[8];s.pmtPid=(t[10]&31)<<8|t[11];e.pmtPid=s.pmtPid};i=function(t,e){var i,n,r,o;if(!(t[5]&1)){return}s.programMapTable={video:null,audio:null,"timed-metadata":{}};i=(t[1]&15)<<8|t[2];n=3+i-4;r=(t[10]&15)<<8|t[11];o=12+r;while(o<n){var a=t[o];var h=(t[o+1]&31)<<8|t[o+2];if(a===ke.H264_STREAM_TYPE&&s.programMapTable.video===null){s.programMapTable.video=h}else if(a===ke.ADTS_STREAM_TYPE&&s.programMapTable.audio===null){s.programMapTable.audio=h}else if(a===ke.METADATA_STREAM_TYPE){s.programMapTable["timed-metadata"][h]=a}o+=((t[o+3]&15)<<8|t[o+4])+5}e.programMapTable=s.programMapTable};this.push=function(e){var i={},s=4;i.payloadUnitStartIndicator=!!(e[1]&64);i.pid=e[1]&31;i.pid<<=8;i.pid|=e[2];if((e[3]&48)>>>4>1){s+=e[s]+1}if(i.pid===0){i.type="pat";t(e.subarray(s),i);this.trigger("data",i)}else if(i.pid===this.pmtPid){i.type="pmt";t(e.subarray(s),i);this.trigger("data",i);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,s,i])}else{this.processPes_(e,s,i)}};this.processPes_=function(t,e,i){if(i.pid===this.programMapTable.video){i.streamType=ke.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=ke.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=t.subarray(e);this.trigger("data",i)}};xe.prototype=new Te;xe.STREAM_TYPES={h264:27,adts:15};Ae=function(){var t=this,e=false,i={data:[],size:0},s={data:[],size:0},n={data:[],size:0},r,o=function(t,e){var i;const s=t[0]<<16|t[1]<<8|t[2];e.data=new Uint8Array;if(s!==1){return}e.packetLength=6+(t[4]<<8|t[5]);e.dataAlignmentIndicator=(t[6]&4)!==0;i=t[7];if(i&192){e.pts=(t[9]&14)<<27|(t[10]&255)<<20|(t[11]&254)<<12|(t[12]&255)<<5|(t[13]&254)>>>3;e.pts*=4;e.pts+=(t[13]&6)>>>1;e.dts=e.pts;if(i&64){e.dts=(t[14]&14)<<27|(t[15]&255)<<20|(t[16]&254)<<12|(t[17]&255)<<5|(t[18]&254)>>>3;e.dts*=4;e.dts+=(t[18]&6)>>>1}}e.data=t.subarray(9+t[8])},a=function(e,i,s){var n=new Uint8Array(e.size),r={type:i},a=0,h=0,u=false,c;if(!e.data.length||e.size<9){return}r.trackId=e.data[0].pid;for(a=0;a<e.data.length;a++){c=e.data[a];n.set(c.data,h);h+=c.data.byteLength}o(n,r);u=i==="video"||r.packetLength<=e.size;if(s||u){e.size=0;e.data.length=0}if(u){t.trigger("data",r)}};Ae.prototype.init.call(this);this.push=function(o){({pat:function(){},pes:function(){var t,e;switch(o.streamType){case ke.H264_STREAM_TYPE:t=i;e="video";break;case ke.ADTS_STREAM_TYPE:t=s;e="audio";break;case ke.METADATA_STREAM_TYPE:t=n;e="timed-metadata";break;default:return}if(o.payloadUnitStartIndicator){a(t,e,true)}t.data.push(o);t.size+=o.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};r=o.programMapTable;if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}e=true;t.trigger("data",i)}})[o.type]()};this.reset=function(){i.size=0;i.data.length=0;s.size=0;s.data.length=0;this.trigger("reset")};this.flushStreams_=function(){a(i,"video");a(s,"audio");a(n,"timed-metadata")};this.flush=function(){if(!e&&r){var i={type:"metadata",tracks:[]};if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}t.trigger("data",i)}e=false;this.flushStreams_();this.trigger("done")}};Ae.prototype=new Te;var je={PAT_PID:0,MP2T_PACKET_LENGTH:De,TransportPacketStream:Ie,TransportParseStream:xe,ElementaryStream:Ae,TimestampRolloverStream:Ee,CaptionStream:Se.CaptionStream,Cea608Stream:Se.Cea608Stream,Cea708Stream:Se.Cea708Stream,MetadataStream:we};for(var _e in ke){if(ke.hasOwnProperty(_e)){je[_e]=ke[_e]}}var Ne=je;var Me=i;var Oe=pt.ONE_SECOND_IN_TS;var Le;var Re=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Le=function(t){var e,i=0;Le.prototype.init.call(this);this.skipWarn_=function(t,e){this.trigger("log",{level:"warn",message:`adts skiping bytes ${t} to ${e} in frame ${i} outside syncword`})};this.push=function(s){var n=0,r,o,a,h,u;if(!t){i=0}if(s.type!=="audio"){return}if(e&&e.length){a=e;e=new Uint8Array(a.byteLength+s.data.byteLength);e.set(a);e.set(s.data,a.byteLength)}else{e=s.data}var c;while(n+7<e.length){if(e[n]!==255||(e[n+1]&246)!==240){if(typeof c!=="number"){c=n}n++;continue}if(typeof c==="number"){this.skipWarn_(c,n);c=null}o=(~e[n+1]&1)*2;r=(e[n+3]&3)<<11|e[n+4]<<3|(e[n+5]&224)>>5;h=((e[n+6]&3)+1)*1024;u=h*Oe/Re[(e[n+2]&60)>>>2];if(e.byteLength-n<r){break}this.trigger("data",{pts:s.pts+i*u,dts:s.dts+i*u,sampleCount:h,audioobjecttype:(e[n+2]>>>6&3)+1,channelcount:(e[n+2]&1)<<2|(e[n+3]&192)>>>6,samplerate:Re[(e[n+2]&60)>>>2],samplingfrequencyindex:(e[n+2]&60)>>>2,samplesize:16,data:e.subarray(n+7+o,n+r)});i++;n+=r}if(typeof c==="number"){this.skipWarn_(c,n);c=null}e=e.subarray(n)};this.flush=function(){i=0;this.trigger("done")};this.reset=function(){e=void 0;this.trigger("reset")};this.endTimeline=function(){e=void 0;this.trigger("endedtimeline")}};Le.prototype=new Me;var $e=Le;var Pe;Pe=function(t){var e=t.byteLength,i=0,s=0;this.length=function(){return 8*e};this.bitsAvailable=function(){return 8*e+s};this.loadWord=function(){var n=t.byteLength-e,r=new Uint8Array(4),o=Math.min(4,e);if(o===0){throw new Error("no bytes available")}r.set(t.subarray(n,n+o));i=new DataView(r.buffer).getUint32(0);s=o*8;e-=o};this.skipBits=function(t){var n;if(s>t){i<<=t;s-=t}else{t-=s;n=Math.floor(t/8);t-=n*8;e-=n;this.loadWord();i<<=t;s-=t}};this.readBits=function(t){var n=Math.min(s,t),r=i>>>32-n;s-=n;if(s>0){i<<=n}else if(e>0){this.loadWord()}n=t-n;if(n>0){return r<<n|this.readBits(n)}return r};this.skipLeadingZeros=function(){var t;for(t=0;t<s;++t){if((i&2147483648>>>t)!==0){i<<=t;s-=t;return t}}this.loadWord();return t+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1};this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();if(1&t){return 1+t>>>1}return-1*(t>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Ue=Pe;var Fe=i;var Be=Ue;var qe,Ve;var He;Ve=function(){var t=0,e,i;Ve.prototype.init.call(this);this.push=function(s){var n;if(!i){i=s.data}else{n=new Uint8Array(i.byteLength+s.data.byteLength);n.set(i);n.set(s.data,i.byteLength);i=n}var r=i.byteLength;for(;t<r-3;t++){if(i[t+2]===1){e=t+5;break}}while(e<r){switch(i[e]){case 0:if(i[e-1]!==0){e+=2;break}else if(i[e-2]!==0){e++;break}if(t+3!==e-2){this.trigger("data",i.subarray(t+3,e-2))}do{e++}while(i[e]!==1&&e<r);t=e-2;e+=3;break;case 1:if(i[e-1]!==0||i[e-2]!==0){e+=3;break}this.trigger("data",i.subarray(t+3,e-2));t=e-2;e+=3;break;default:e+=3;break}}i=i.subarray(t);e-=t;t=0};this.reset=function(){i=null;t=0;this.trigger("reset")};this.flush=function(){if(i&&i.byteLength>3){this.trigger("data",i.subarray(t+3))}i=null;t=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};Ve.prototype=new Fe;He={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};qe=function(){var t=new Ve,e,i,s,n,r,o,a;qe.prototype.init.call(this);e=this;this.push=function(e){if(e.type!=="video"){return}i=e.trackId;s=e.pts;n=e.dts;t.push(e)};t.on("data",(function(t){var a={trackId:i,pts:s,dts:n,data:t,nalUnitTypeCode:t[0]&31};switch(a.nalUnitTypeCode){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp";a.escapedRBSP=r(t.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp";a.escapedRBSP=r(t.subarray(1));a.config=o(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",a)}));t.on("done",(function(){e.trigger("done")}));t.on("partialdone",(function(){e.trigger("partialdone")}));t.on("reset",(function(){e.trigger("reset")}));t.on("endedtimeline",(function(){e.trigger("endedtimeline")}));this.flush=function(){t.flush()};this.partialFlush=function(){t.partialFlush()};this.reset=function(){t.reset()};this.endTimeline=function(){t.endTimeline()};a=function(t,e){var i=8,s=8,n,r;for(n=0;n<t;n++){if(s!==0){r=e.readExpGolomb();s=(i+r+256)%256}i=s===0?i:s}};r=function(t){var e=t.byteLength,i=[],s=1,n,r;while(s<e-2){if(t[s]===0&&t[s+1]===0&&t[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return t}n=e-i.length;r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=t[o]}return r};o=function(t){var e=0,i=0,s=0,n=0,r,o,h,u,c,f,l,d,p,m,v,g=[1,1],y,b;r=new Be(t);o=r.readUnsignedByte();u=r.readUnsignedByte();h=r.readUnsignedByte();r.skipUnsignedExpGolomb();if(He[o]){c=r.readUnsignedExpGolomb();if(c===3){r.skipBits(1)}r.skipUnsignedExpGolomb();r.skipUnsignedExpGolomb();r.skipBits(1);if(r.readBoolean()){v=c!==3?8:12;for(b=0;b<v;b++){if(r.readBoolean()){if(b<6){a(16,r)}else{a(64,r)}}}}}r.skipUnsignedExpGolomb();f=r.readUnsignedExpGolomb();if(f===0){r.readUnsignedExpGolomb()}else if(f===1){r.skipBits(1);r.skipExpGolomb();r.skipExpGolomb();l=r.readUnsignedExpGolomb();for(b=0;b<l;b++){r.skipExpGolomb()}}r.skipUnsignedExpGolomb();r.skipBits(1);d=r.readUnsignedExpGolomb();p=r.readUnsignedExpGolomb();m=r.readBits(1);if(m===0){r.skipBits(1)}r.skipBits(1);if(r.readBoolean()){e=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}}}}return{profileIdc:o,levelIdc:h,profileCompatibility:u,width:(d+1)*16-e*2-i*2,height:(2-m)*(p+1)*16-s*2-n*2,sarRatio:g}}};qe.prototype=new Fe;var ze={H264Stream:qe,NalByteStream:Ve};var Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var Ge=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9],s=t[e+5],n=(s&16)>>4;i=i>=0?i:0;if(n){return i+20}return i+10};var We=function(t,e){if(t.length-e<10||t[e]!=="I".charCodeAt(0)||t[e+1]!=="D".charCodeAt(0)||t[e+2]!=="3".charCodeAt(0)){return e}e+=Ge(t,e);return We(t,e)};var Ye=function(t){var e=We(t,0);return t.length>=e+2&&(t[e]&255)===255&&(t[e+1]&240)===240&&(t[e+1]&22)===16};var Ke=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]};var Qe=function(t,e,i){var s,n="";for(s=e;s<i;s++){n+="%"+("00"+t[s].toString(16)).slice(-2)}return n};var Je=function(t,e,i){return unescape(Qe(t,e,i))};var Ze=function(t,e){var i=(t[e+5]&224)>>5,s=t[e+4]<<3,n=t[e+3]&3<<11;return n|s|i};var ti=function(t,e){if(t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(t[e]&255===255&&(t[e+1]&240)===240){return"audio"}return null};var ei=function(t){var e=0;while(e+5<t.length){if(t[e]!==255||(t[e+1]&246)!==240){e++;continue}return Xe[(t[e+2]&60)>>>2]}return null};var ii=function(t){var e,i,s,n;e=10;if(t[5]&64){e+=4;e+=Ke(t.subarray(10,14))}do{i=Ke(t.subarray(e+4,e+8));if(i<1){return null}n=String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3]);if(n==="PRIV"){s=t.subarray(e+10,e+i+10);for(var r=0;r<s.byteLength;r++){if(s[r]===0){var o=Je(s,0,r);if(o==="com.apple.streaming.transportStreamTimestamp"){var a=s.subarray(r+1);var h=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;h*=4;h+=a[7]&3;return h}break}}}e+=10;e+=i}while(e<t.byteLength);return null};var si={isLikelyAacData:Ye,parseId3TagSize:Ge,parseAdtsSize:Ze,parseType:ti,parseSampleRate:ei,parseAacTimestamp:ii};var ni=i;var ri=si;var oi;oi=function(){var t=new Uint8Array,e=0;oi.prototype.init.call(this);this.setTimestamp=function(t){e=t};this.push=function(i){var s=0,n=0,r,o,a,h;if(t.length){h=t.length;t=new Uint8Array(i.byteLength+h);t.set(t.subarray(0,h));t.set(i,h)}else{t=i}while(t.length-n>=3){if(t[n]==="I".charCodeAt(0)&&t[n+1]==="D".charCodeAt(0)&&t[n+2]==="3".charCodeAt(0)){if(t.length-n<10){break}s=ri.parseId3TagSize(t,n);if(n+s>t.length){break}o={type:"timed-metadata",data:t.subarray(n,n+s)};this.trigger("data",o);n+=s;continue}else if((t[n]&255)===255&&(t[n+1]&240)===240){if(t.length-n<7){break}s=ri.parseAdtsSize(t,n);if(n+s>t.length){break}a={type:"audio",data:t.subarray(n,n+s),pts:e,dts:e};this.trigger("data",a);n+=s;continue}n++}r=t.length-n;if(r>0){t=t.subarray(n)}else{t=new Uint8Array}};this.reset=function(){t=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){t=new Uint8Array;this.trigger("endedtimeline")}};oi.prototype=new ni;var ai=oi;var hi=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var ui=hi;var ci=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var fi=ci;var li=i;var di=V;var pi=Z;var mi=St;var vi=At;var gi=Ne;var yi=pt;var bi=$e;var wi=ze.H264Stream;var Ti=ai;var Si=si.isLikelyAacData;var ki=pt.ONE_SECOND_IN_TS;var Ei=ui;var Ii=fi;var xi,Ai,Di,Ci;var ji=function(t,e){e.stream=t;this.trigger("log",e)};var _i=function(t,e){var i=Object.keys(e);for(var s=0;s<i.length;s++){var n=i[s];if(n==="headOfPipeline"||!e[n].on){continue}e[n].on("log",ji.bind(t,n))}};var Ni=function(t,e){var i;if(t.length!==e.length){return false}for(i=0;i<t.length;i++){if(t[i]!==e[i]){return false}}return true};var Mi=function(t,e,i,s,n,r){var o=i-e,a=s-e,h=n-i;return{start:{dts:t,pts:t+o},end:{dts:t+a,pts:t+h},prependedContentDuration:r,baseMediaDecodeTime:t}};Ai=function(t,e){var i=[],s,n=0,r=0,o=Infinity;e=e||{};s=e.firstSequenceNumber||0;Ai.prototype.init.call(this);this.push=function(e){vi.collectDtsInfo(t,e);if(t){Ei.forEach((function(i){t[i]=e[i]}))}i.push(e)};this.setEarliestDts=function(t){n=t};this.setVideoBaseMediaDecodeTime=function(t){o=t};this.setAudioAppendStart=function(t){r=t};this.flush=function(){var a,h,u,c,f,l,d;if(i.length===0){this.trigger("done","AudioSegmentStream");return}a=mi.trimAdtsFramesByEarliestDts(i,t,n);t.baseMediaDecodeTime=vi.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);d=mi.prefixWithSilence(t,a,r,o);t.samples=mi.generateSampleTable(a);u=di.mdat(mi.concatenateFrameData(a));i=[];h=di.moof(s,[t]);c=new Uint8Array(h.byteLength+u.byteLength);s++;c.set(h);c.set(u,h.byteLength);vi.clearDtsInfo(t);f=Math.ceil(ki*1024/t.samplerate);if(a.length){l=a.length*f;this.trigger("segmentTimingInfo",Mi(yi.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),a[0].dts,a[0].pts,a[0].dts+l,a[0].pts+l,d||0));this.trigger("timingInfo",{start:a[0].pts,end:a[0].pts+l})}this.trigger("data",{track:t,boxes:c});this.trigger("done","AudioSegmentStream")};this.reset=function(){vi.clearDtsInfo(t);i=[];this.trigger("reset")}};Ai.prototype=new li;xi=function(t,e){var i,s=[],n=[],r,o;e=e||{};i=e.firstSequenceNumber||0;xi.prototype.init.call(this);delete t.minPTS;this.gopCache_=[];this.push=function(e){vi.collectDtsInfo(t,e);if(e.nalUnitType==="seq_parameter_set_rbsp"&&!r){r=e.config;t.sps=[e.data];Ii.forEach((function(e){t[e]=r[e]}),this)}if(e.nalUnitType==="pic_parameter_set_rbsp"&&!o){o=e.data;t.pps=[e.data]}s.push(e)};this.flush=function(){var r,o,a,h,u,c,f=0,l,d;while(s.length){if(s[0].nalUnitType==="access_unit_delimiter_rbsp"){break}s.shift()}if(s.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}r=pi.groupNalsIntoFrames(s);a=pi.groupFramesIntoGops(r);if(!a[0][0].keyFrame){o=this.getGopForFusion_(s[0],t);if(o){f=o.duration;a.unshift(o);a.byteLength+=o.byteLength;a.nalCount+=o.nalCount;a.pts=o.pts;a.dts=o.dts;a.duration+=o.duration}else{a=pi.extendFirstKeyFrame(a)}}if(n.length){var p;if(e.alignGopsAtEnd){p=this.alignGopsAtEnd_(a)}else{p=this.alignGopsAtStart_(a)}if(!p){this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}vi.clearDtsInfo(t);a=p}vi.collectDtsInfo(t,a);t.samples=pi.generateSampleTable(a);u=di.mdat(pi.concatenateNalData(a));t.baseMediaDecodeTime=vi.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);this.trigger("processedGopsInfo",a.map((function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})));l=a[0];d=a[a.length-1];this.trigger("segmentTimingInfo",Mi(t.baseMediaDecodeTime,l.dts,l.pts,d.dts+d.duration,d.pts+d.duration,f));this.trigger("timingInfo",{start:a[0].pts,end:a[a.length-1].pts+a[a.length-1].duration});this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime);this.trigger("timelineStartInfo",t.timelineStartInfo);h=di.moof(i,[t]);c=new Uint8Array(h.byteLength+u.byteLength);i++;c.set(h);c.set(u,h.byteLength);this.trigger("data",{track:t,boxes:c});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();s=[];this.gopCache_.length=0;n.length=0;this.trigger("reset")};this.resetStream_=function(){vi.clearDtsInfo(t);r=undefined;o=undefined};this.getGopForFusion_=function(e){var i=45e3,s=1e4,n=Infinity,r,o,a,h,u;for(u=0;u<this.gopCache_.length;u++){h=this.gopCache_[u];a=h.gop;if(!(t.pps&&Ni(t.pps[0],h.pps[0]))||!(t.sps&&Ni(t.sps[0],h.sps[0]))){continue}if(a.dts<t.timelineStartInfo.dts){continue}r=e.dts-a.dts-a.duration;if(r>=-s&&r<=i){if(!o||n>r){o=h;n=r}}}if(o){return o.gop}return null};this.alignGopsAtStart_=function(t){var e,i,s,r,o,a,h,u;o=t.byteLength;a=t.nalCount;h=t.duration;e=i=0;while(e<n.length&&i<t.length){s=n[e];r=t[i];if(s.pts===r.pts){break}if(r.pts>s.pts){e++;continue}i++;o-=r.byteLength;a-=r.nalCount;h-=r.duration}if(i===0){return t}if(i===t.length){return null}u=t.slice(i);u.byteLength=o;u.duration=h;u.nalCount=a;u.pts=u[0].pts;u.dts=u[0].dts;return u};this.alignGopsAtEnd_=function(t){var e,i,s,r,o,a;e=n.length-1;i=t.length-1;o=null;a=false;while(e>=0&&i>=0){s=n[e];r=t[i];if(s.pts===r.pts){a=true;break}if(s.pts>r.pts){e--;continue}if(e===n.length-1){o=i}i--}if(!a&&o===null){return null}var h;if(a){h=i}else{h=o}if(h===0){return t}var u=t.slice(h);var c=u.reduce((function(t,e){t.byteLength+=e.byteLength;t.duration+=e.duration;t.nalCount+=e.nalCount;return t}),{byteLength:0,duration:0,nalCount:0});u.byteLength=c.byteLength;u.duration=c.duration;u.nalCount=c.nalCount;u.pts=u[0].pts;u.dts=u[0].dts;return u};this.alignGopsWith=function(t){n=t}};xi.prototype=new li;Ci=function(t,e){this.numberOfTracks=0;this.metadataStream=e;t=t||{};if(typeof t.remux!=="undefined"){this.remuxTracks=!!t.remux}else{this.remuxTracks=true}if(typeof t.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=t.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;Ci.prototype.init.call(this);this.push=function(t){if(t.content||t.text){return this.pendingCaptions.push(t)}if(t.frames){return this.pendingMetadata.push(t)}this.pendingTracks.push(t.track);this.pendingBytes+=t.boxes.byteLength;if(t.track.type==="video"){this.videoTrack=t.track;this.pendingBoxes.push(t.boxes)}if(t.track.type==="audio"){this.audioTrack=t.track;this.pendingBoxes.unshift(t.boxes)}}};Ci.prototype=new li;Ci.prototype.flush=function(t){var e=0,i={captions:[],captionStreams:{},metadata:[],info:{}},s,n,r,o=0,a;if(this.pendingTracks.length<this.numberOfTracks){if(t!=="VideoSegmentStream"&&t!=="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){o=this.videoTrack.timelineStartInfo.pts;Ii.forEach((function(t){i.info[t]=this.videoTrack[t]}),this)}else if(this.audioTrack){o=this.audioTrack.timelineStartInfo.pts;Ei.forEach((function(t){i.info[t]=this.audioTrack[t]}),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=di.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(a=0;a<this.pendingBoxes.length;a++){i.data.set(this.pendingBoxes[a],e);e+=this.pendingBoxes[a].byteLength}for(a=0;a<this.pendingCaptions.length;a++){s=this.pendingCaptions[a];s.startTime=yi.metadataTsToSeconds(s.startPts,o,this.keepOriginalTimestamps);s.endTime=yi.metadataTsToSeconds(s.endPts,o,this.keepOriginalTimestamps);i.captionStreams[s.stream]=true;i.captions.push(s)}for(a=0;a<this.pendingMetadata.length;a++){n=this.pendingMetadata[a];n.cueTime=yi.metadataTsToSeconds(n.pts,o,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(a=0;a<i.captions.length;a++){s=i.captions[a];this.trigger("caption",s)}for(a=0;a<i.metadata.length;a++){n=i.metadata[a];this.trigger("id3Frame",n)}}if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};Ci.prototype.setRemux=function(t){this.remuxTracks=t};Di=function(t){var e=this,i=true,s,n;Di.prototype.init.call(this);t=t||{};this.baseMediaDecodeTime=t.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="aac";i.metadataStream=new gi.MetadataStream;i.aacStream=new Ti;i.audioTimestampRolloverStream=new gi.TimestampRolloverStream("audio");i.timedMetadataTimestampRolloverStream=new gi.TimestampRolloverStream("timed-metadata");i.adtsStream=new bi;i.coalesceStream=new Ci(t,i.metadataStream);i.headOfPipeline=i.aacStream;i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream);i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream);i.metadataStream.on("timestamp",(function(t){i.aacStream.setTimestamp(t.timeStamp)}));i.aacStream.on("data",(function(r){if(r.type!=="timed-metadata"&&r.type!=="audio"||i.audioSegmentStream){return}n=n||{timelineStartInfo:{baseMediaDecodeTime:e.baseMediaDecodeTime},codec:"adts",type:"audio"};i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ai(n,t);i.audioSegmentStream.on("log",e.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream);e.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}));i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));_i(this,i)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new gi.MetadataStream;i.packetStream=new gi.TransportPacketStream;i.parseStream=new gi.TransportParseStream;i.elementaryStream=new gi.ElementaryStream;i.timestampRolloverStream=new gi.TimestampRolloverStream;i.adtsStream=new bi;i.h264Stream=new wi;i.captionStream=new gi.CaptionStream(t);i.coalesceStream=new Ci(t,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(r){var o;if(r.type==="metadata"){o=r.tracks.length;while(o--){if(!s&&r.tracks[o].type==="video"){s=r.tracks[o];s.timelineStartInfo.baseMediaDecodeTime=e.baseMediaDecodeTime}else if(!n&&r.tracks[o].type==="audio"){n=r.tracks[o];n.timelineStartInfo.baseMediaDecodeTime=e.baseMediaDecodeTime}}if(s&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new xi(s,t);i.videoSegmentStream.on("log",e.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",(function(s){if(n&&!t.keepOriginalTimestamps){n.timelineStartInfo=s;i.audioSegmentStream.setEarliestDts(s.dts-e.baseMediaDecodeTime)}}));i.videoSegmentStream.on("processedGopsInfo",e.trigger.bind(e,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",e.trigger.bind(e,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",(function(t){if(n){i.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}}));i.videoSegmentStream.on("timingInfo",e.trigger.bind(e,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(n&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ai(n,t);i.audioSegmentStream.on("log",e.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",e.trigger.bind(e,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}e.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}}));i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",(function(t){t.dispatchType=i.metadataStream.dispatchType;e.trigger("id3Frame",t)}));i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));_i(this,i)};this.setBaseMediaDecodeTime=function(e){var i=this.transmuxPipeline_;if(!t.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(n){n.timelineStartInfo.dts=undefined;n.timelineStartInfo.pts=undefined;vi.clearDtsInfo(n);if(i.audioTimestampRolloverStream){i.audioTimestampRolloverStream.discontinuity()}}if(s){if(i.videoSegmentStream){i.videoSegmentStream.gopCache_=[]}s.timelineStartInfo.dts=undefined;s.timelineStartInfo.pts=undefined;vi.clearDtsInfo(s);i.captionStream.reset()}if(i.timestampRolloverStream){i.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(t){if(n){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)}};this.setRemux=function(e){var i=this.transmuxPipeline_;t.remux=e;if(i&&i.coalesceStream){i.coalesceStream.setRemux(e)}};this.alignGopsWith=function(t){if(s&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)}};this.getLogTrigger_=function(t){var e=this;return function(i){i.stream=t;e.trigger("log",i)}};this.push=function(t){if(i){var e=Si(t);if(e&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!e&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(t)};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()}}};Di.prototype=new li;var Oi={Transmuxer:Di,VideoSegmentStream:xi,AudioSegmentStream:Ai,AUDIO_PROPERTIES:Ei,VIDEO_PROPERTIES:Ii,generateSegmentTimingInfo:Mi};var Li=function(t){return t>>>0};var Ri=function(t){return("00"+t.toString(16)).slice(-2)};var $i={toUnsigned:Li,toHexString:Ri};var Pi=function(t){var e="";e+=String.fromCharCode(t[0]);e+=String.fromCharCode(t[1]);e+=String.fromCharCode(t[2]);e+=String.fromCharCode(t[3]);return e};var Ui=Pi;var Fi=$i.toUnsigned;var Bi=Ui;var qi=function(t,e){var i=[],s,n,r,o,a;if(!e.length){return null}for(s=0;s<t.byteLength;){n=Fi(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]);r=Bi(t.subarray(s+4,s+8));o=n>1?s+n:t.byteLength;if(r===e[0]){if(e.length===1){i.push(t.subarray(s+8,o))}else{a=qi(t.subarray(s+8,o),e.slice(1));if(a.length){i=i.concat(a)}}}s=o}return i};var Vi=qi;var Hi=$i.toUnsigned;var zi=r.getUint64;var Xi=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4))};if(e.version===1){e.baseMediaDecodeTime=zi(t.subarray(4))}else{e.baseMediaDecodeTime=Hi(t[4]<<24|t[5]<<16|t[6]<<8|t[7])}return e};var Gi=Xi;var Wi=function(t){return{isLeading:(t[0]&12)>>>2,dependsOn:t[0]&3,isDependedOn:(t[1]&192)>>>6,hasRedundancy:(t[1]&48)>>>4,paddingValue:(t[1]&14)>>>1,isNonSyncSample:t[1]&1,degradationPriority:t[2]<<8|t[3]}};var Yi=Wi;var Ki=Yi;var Qi=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},i=new DataView(t.buffer,t.byteOffset,t.byteLength),s=e.flags[2]&1,n=e.flags[2]&4,r=e.flags[1]&1,o=e.flags[1]&2,a=e.flags[1]&4,h=e.flags[1]&8,u=i.getUint32(4),c=8,f;if(s){e.dataOffset=i.getInt32(c);c+=4}if(n&&u){f={flags:Ki(t.subarray(c,c+4))};c+=4;if(r){f.duration=i.getUint32(c);c+=4}if(o){f.size=i.getUint32(c);c+=4}if(h){if(e.version===1){f.compositionTimeOffset=i.getInt32(c)}else{f.compositionTimeOffset=i.getUint32(c)}c+=4}e.samples.push(f);u--}while(u--){f={};if(r){f.duration=i.getUint32(c);c+=4}if(o){f.size=i.getUint32(c);c+=4}if(a){f.flags=Ki(t.subarray(c,c+4));c+=4}if(h){if(e.version===1){f.compositionTimeOffset=i.getInt32(c)}else{f.compositionTimeOffset=i.getUint32(c)}c+=4}e.samples.push(f)}return e};var Ji=Qi;var Zi=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4)},s=i.flags[2]&1,n=i.flags[2]&2,r=i.flags[2]&8,o=i.flags[2]&16,a=i.flags[2]&32,h=i.flags[0]&65536,u=i.flags[0]&131072,c;c=8;if(s){c+=4;i.baseDataOffset=e.getUint32(12);c+=4}if(n){i.sampleDescriptionIndex=e.getUint32(c);c+=4}if(r){i.defaultSampleDuration=e.getUint32(c);c+=4}if(o){i.defaultSampleSize=e.getUint32(c);c+=4}if(a){i.defaultSampleFlags=e.getUint32(c)}if(h){i.durationIsEmpty=true}if(!s&&u){i.baseDataOffsetIsMoof=true}return i};var ts=Zi;var es;if(typeof window!=="undefined"){es=window}else if(typeof t!=="undefined"){es=t}else if(typeof self!=="undefined"){es=self}else{es={}}var is=es;var ss=Ot.discardEmulationPreventionBytes;var ns=Kt.CaptionStream;var rs=Vi;var os=Gi;var as=Ji;var hs=ts;var us=is;var cs=function(t,e){var i=t;for(var s=0;s<e.length;s++){var n=e[s];if(i<n.size){return n}i-=n.size}return null};var fs=function(t,e,i){var s=new DataView(t.buffer,t.byteOffset,t.byteLength),n={logs:[],seiNals:[]},r,o,a,h;for(o=0;o+4<t.length;o+=a){a=s.getUint32(o);o+=4;if(a<=0){continue}switch(t[o]&31){case 6:var u=t.subarray(o+1,o+1+a);var c=cs(o,e);r={nalUnitType:"sei_rbsp",size:a,data:u,escapedRBSP:ss(u),trackId:i};if(c){r.pts=c.pts;r.dts=c.dts;h=c}else if(h){r.pts=h.pts;r.dts=h.dts}else{n.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+o+" for trackId "+i+". See mux.js#223."});break}n.seiNals.push(r);break}}return n};var ls=function(t,e,i){var s=e;var n=i.defaultSampleDuration||0;var r=i.defaultSampleSize||0;var o=i.trackId;var a=[];t.forEach((function(t){var e=as(t);var i=e.samples;i.forEach((function(t){if(t.duration===undefined){t.duration=n}if(t.size===undefined){t.size=r}t.trackId=o;t.dts=s;if(t.compositionTimeOffset===undefined){t.compositionTimeOffset=0}if(typeof s==="bigint"){t.pts=s+us.BigInt(t.compositionTimeOffset);s+=us.BigInt(t.duration)}else{t.pts=s+t.compositionTimeOffset;s+=t.duration}}));a=a.concat(i)}));return a};var ds=function(t,e){var i=rs(t,["moof","traf"]);var s=rs(t,["mdat"]);var n={};var r=[];s.forEach((function(t,e){var s=i[e];r.push({mdat:t,traf:s})}));r.forEach((function(t){var i=t.mdat;var s=t.traf;var r=rs(s,["tfhd"]);var o=hs(r[0]);var a=o.trackId;var h=rs(s,["tfdt"]);var u=h.length>0?os(h[0]).baseMediaDecodeTime:0;var c=rs(s,["trun"]);var f;var l;if(e===a&&c.length>0){f=ls(c,u,o);l=fs(i,f,a);if(!n[a]){n[a]={seiNals:[],logs:[]}}n[a].seiNals=n[a].seiNals.concat(l.seiNals);n[a].logs=n[a].logs.concat(l.logs)}}));return n};var ps=function(t,e,i){var s;if(e===null){return null}s=ds(t,e);var n=s[e]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}};var ms=function(){var t=false;var e;var i;var s;var n;var r;var o;this.isInitialized=function(){return t};this.init=function(i){e=new ns;t=true;o=i?i.isPartial:false;e.on("data",(function(t){t.startTime=t.startPts/n;t.endTime=t.endPts/n;r.captions.push(t);r.captionStreams[t.stream]=true}));e.on("log",(function(t){r.logs.push(t)}))};this.isNewInit=function(t,e){if(t&&t.length===0||e&&typeof e==="object"&&Object.keys(e).length===0){return false}return s!==t[0]||n!==e[s]};this.parse=function(t,e,o){var a;if(!this.isInitialized()){return null}else if(!e||!o){return null}else if(this.isNewInit(e,o)){s=e[0];n=o[s]}else if(s===null||!n){i.push(t);return null}while(i.length>0){var h=i.shift();this.parse(h,e,o)}a=ps(t,s,n);if(a&&a.logs){r.logs=r.logs.concat(a.logs)}if(a===null||!a.seiNals){if(r.logs.length){return{logs:r.logs,captions:[],captionStreams:[]}}return null}this.pushNals(a.seiNals);this.flushStream();return r};this.pushNals=function(t){if(!this.isInitialized()||!t||t.length===0){return null}t.forEach((function(t){e.push(t)}))};this.flushStream=function(){if(!this.isInitialized()){return null}if(!o){e.flush()}else{e.partialFlush()}};this.clearParsedCaptions=function(){r.captions=[];r.captionStreams={};r.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}e.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){i=[];s=null;n=null;if(!r){r={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var vs=ms;var gs=function(t){var e=0;var i=String.fromCharCode(t[e]);var s="";while(i!=="\0"){s+=i;e++;i=String.fromCharCode(t[e])}s+=i;return s};var ys={uint8ToCString:gs};var bs=ys.uint8ToCString;var ws=r.getUint64;var Ts=function(t){var e=4;var i=t[0];var s,n,r,o,a,h,u,c;if(i===0){s=bs(t.subarray(e));e+=s.length;n=bs(t.subarray(e));e+=n.length;var f=new DataView(t.buffer);r=f.getUint32(e);e+=4;a=f.getUint32(e);e+=4;h=f.getUint32(e);e+=4;u=f.getUint32(e);e+=4}else if(i===1){var f=new DataView(t.buffer);r=f.getUint32(e);e+=4;o=ws(t.subarray(e));e+=8;h=f.getUint32(e);e+=4;u=f.getUint32(e);e+=4;s=bs(t.subarray(e));e+=s.length;n=bs(t.subarray(e));e+=n.length}c=new Uint8Array(t.subarray(e,t.byteLength));var l={scheme_id_uri:s,value:n,timescale:r?r:1,presentation_time:o,presentation_time_delta:a,event_duration:h,id:u,message_data:c};return ks(i,l)?l:undefined};var Ss=function(t,e,i,s){return t||t===0?t/e:s+i/e};var ks=function(t,e){var i=e.scheme_id_uri!=="\0";var s=t===0&&Es(e.presentation_time_delta)&&i;var n=t===1&&Es(e.presentation_time)&&i;return!(t>1)&&s||n};var Es=function(t){return t!==undefined||t!==null};var Is={parseEmsgBox:Ts,scaleTime:Ss};var xs=$i.toUnsigned;var As=$i.toHexString;var Ds=Vi;var Cs=Ui;var js=Is;var _s=ts;var Ns=Ji;var Ms=Gi;var Os=r.getUint64;var Ls,Rs,$s,Ps,Us,Fs,Bs;var qs=is;var Vs=me.parseId3Frames;Ls=function(t){var e={},i=Ds(t,["moov","trak"]);return i.reduce((function(t,e){var i,s,n,r,o;i=Ds(e,["tkhd"])[0];if(!i){return null}s=i[0];n=s===0?12:20;r=xs(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);o=Ds(e,["mdia","mdhd"])[0];if(!o){return null}s=o[0];n=s===0?12:20;t[r]=xs(o[n]<<24|o[n+1]<<16|o[n+2]<<8|o[n+3]);return t}),e)};Rs=function(t,e){var i;i=Ds(e,["moof","traf"]);var s=i.reduce((function(e,i){var s=Ds(i,["tfhd"])[0];var n=xs(s[4]<<24|s[5]<<16|s[6]<<8|s[7]);var r=t[n]||9e4;var o=Ds(i,["tfdt"])[0];var a=new DataView(o.buffer,o.byteOffset,o.byteLength);var h;if(o[0]===1){h=Os(o.subarray(4,12))}else{h=a.getUint32(4)}let u;if(typeof h==="bigint"){u=h/qs.BigInt(r)}else if(typeof h==="number"&&!isNaN(h)){u=h/r}if(u<Number.MAX_SAFE_INTEGER){u=Number(u)}if(u<e){e=u}return e}),Infinity);return typeof s==="bigint"||isFinite(s)?s:0};$s=function(t,e){var i=Ds(e,["moof","traf"]);var s=0;var n=0;var r;if(i&&i.length){var o=Ds(i[0],["tfhd"])[0];var a=Ds(i[0],["trun"])[0];var h=Ds(i[0],["tfdt"])[0];if(o){var u=_s(o);r=u.trackId}if(h){var c=Ms(h);s=c.baseMediaDecodeTime}if(a){var f=Ns(a);if(f.samples&&f.samples.length){n=f.samples[0].compositionTimeOffset||0}}}var l=t[r]||9e4;if(typeof s==="bigint"){n=qs.BigInt(n);l=qs.BigInt(l)}var d=(s+n)/l;if(typeof d==="bigint"&&d<Number.MAX_SAFE_INTEGER){d=Number(d)}return d};Ps=function(t){var e=Ds(t,["moov","trak"]);var i=[];e.forEach((function(t){var e=Ds(t,["mdia","hdlr"]);var s=Ds(t,["tkhd"]);e.forEach((function(t,e){var n=Cs(t.subarray(8,12));var r=s[e];var o;var a;var h;if(n==="vide"){o=new DataView(r.buffer,r.byteOffset,r.byteLength);a=o.getUint8(0);h=a===0?o.getUint32(12):o.getUint32(20);i.push(h)}}))}));return i};Fs=function(t){var e=t[0];var i=e===0?12:20;return xs(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])};Us=function(t){var e=Ds(t,["moov","trak"]);var i=[];e.forEach((function(t){var e={};var s=Ds(t,["tkhd"])[0];var n,r;if(s){n=new DataView(s.buffer,s.byteOffset,s.byteLength);r=n.getUint8(0);e.id=r===0?n.getUint32(12):n.getUint32(20)}var o=Ds(t,["mdia","hdlr"])[0];if(o){var a=Cs(o.subarray(8,12));if(a==="vide"){e.type="video"}else if(a==="soun"){e.type="audio"}else{e.type=a}}var h=Ds(t,["mdia","minf","stbl","stsd"])[0];if(h){var u=h.subarray(8);e.codec=Cs(u.subarray(4,8));var c=Ds(u,[e.codec])[0];var f,l;if(c){if(/^[asm]vc[1-9]$/i.test(e.codec)){f=c.subarray(78);l=Cs(f.subarray(4,8));if(l==="avcC"&&f.length>11){e.codec+=".";e.codec+=As(f[9]);e.codec+=As(f[10]);e.codec+=As(f[11])}else{e.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(e.codec)){f=c.subarray(28);l=Cs(f.subarray(4,8));if(l==="esds"&&f.length>20&&f[19]!==0){e.codec+="."+As(f[19]);e.codec+="."+As(f[20]>>>2&63).replace(/^0/,"")}else{e.codec="mp4a.40.2"}}else{e.codec=e.codec.toLowerCase()}}}var d=Ds(t,["mdia","mdhd"])[0];if(d){e.timescale=Fs(d)}i.push(e)}));return i};Bs=function(t,e=0){var i=Ds(t,["emsg"]);return i.map((t=>{var i=js.parseEmsgBox(new Uint8Array(t));var s=Vs(i.message_data);return{cueTime:js.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,e),duration:js.scaleTime(i.event_duration,i.timescale),frames:s}}))};var Hs={findBox:Ds,parseType:Cs,timescale:Ls,startTime:Rs,compositionStartTime:$s,videoTrackIds:Ps,tracks:Us,getTimescaleFromMediaHeader:Fs,getEmsgID3:Bs};var zs=Qt;var Xs=function(t){var e=t[1]&31;e<<=8;e|=t[2];return e};var Gs=function(t){return!!(t[1]&64)};var Ws=function(t){var e=0;if((t[3]&48)>>>4>1){e+=t[4]+1}return e};var Ys=function(t,e){var i=Xs(t);if(i===0){return"pat"}else if(i===e){return"pmt"}else if(e){return"pes"}return null};var Ks=function(t){var e=Gs(t);var i=4+Ws(t);if(e){i+=t[i]+1}return(t[i+10]&31)<<8|t[i+11]};var Qs=function(t){var e={};var i=Gs(t);var s=4+Ws(t);if(i){s+=t[s]+1}if(!(t[s+5]&1)){return}var n,r,o;n=(t[s+1]&15)<<8|t[s+2];r=3+n-4;o=(t[s+10]&15)<<8|t[s+11];var a=12+o;while(a<r){var h=s+a;e[(t[h+1]&31)<<8|t[h+2]]=t[h];a+=((t[h+3]&15)<<8|t[h+4])+5}return e};var Js=function(t,e){var i=Xs(t);var s=e[i];switch(s){case zs.H264_STREAM_TYPE:return"video";case zs.ADTS_STREAM_TYPE:return"audio";case zs.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}};var Zs=function(t){var e=Gs(t);if(!e){return null}var i=4+Ws(t);if(i>=t.byteLength){return null}var s=null;var n;n=t[i+7];if(n&192){s={};s.pts=(t[i+9]&14)<<27|(t[i+10]&255)<<20|(t[i+11]&254)<<12|(t[i+12]&255)<<5|(t[i+13]&254)>>>3;s.pts*=4;s.pts+=(t[i+13]&6)>>>1;s.dts=s.pts;if(n&64){s.dts=(t[i+14]&14)<<27|(t[i+15]&255)<<20|(t[i+16]&254)<<12|(t[i+17]&255)<<5|(t[i+18]&254)>>>3;s.dts*=4;s.dts+=(t[i+18]&6)>>>1}}return s};var tn=function(t){switch(t){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 en=function(t){var e=4+Ws(t);var i=t.subarray(e);var s=0;var n=0;var r=false;var o;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){o=tn(i[n+3]&31);if(o==="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}o=tn(i[n+3]&31);if(o==="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){o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var sn={parseType:Ys,parsePat:Ks,parsePmt:Qs,parsePayloadUnitStartIndicator:Gs,parsePesType:Js,parsePesTime:Zs,videoPacketContainsKeyFrame:en};var nn=Qt;var rn=ne.handleRollover;var on={};on.ts=sn;on.aac=si;var an=pt.ONE_SECOND_IN_TS;var hn=188,un=71;var cn=function(t,e){var i=0,s=hn,n,r;while(s<t.byteLength){if(t[i]===un&&t[s]===un){n=t.subarray(i,s);r=on.ts.parseType(n,e.pid);switch(r){case"pat":e.pid=on.ts.parsePat(n);break;case"pmt":var o=on.ts.parsePmt(n);e.table=e.table||{};Object.keys(o).forEach((function(t){e.table[t]=o[t]}));break}i+=hn;s+=hn;continue}i++;s++}};var fn=function(t,e,i){var s=0,n=hn,r,o,a,h,u;var c=false;while(n<=t.byteLength){if(t[s]===un&&(t[n]===un||n===t.byteLength)){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="audio"&&h){u=on.ts.parsePesTime(r);if(u){u.type="audio";i.audio.push(u);c=true}}break}if(c){break}s+=hn;n+=hn;continue}s++;n++}n=t.byteLength;s=n-hn;c=false;while(s>=0){if(t[s]===un&&(t[n]===un||n===t.byteLength)){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="audio"&&h){u=on.ts.parsePesTime(r);if(u){u.type="audio";i.audio.push(u);c=true}}break}if(c){break}s-=hn;n-=hn;continue}s--;n--}};var ln=function(t,e,i){var s=0,n=hn,r,o,a,h,u,c,f,l;var d=false;var p={data:[],size:0};while(n<t.byteLength){if(t[s]===un&&t[n]===un){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="video"){if(h&&!d){u=on.ts.parsePesTime(r);if(u){u.type="video";i.video.push(u);d=true}}if(!i.firstKeyFrame){if(h){if(p.size!==0){c=new Uint8Array(p.size);f=0;while(p.data.length){l=p.data.shift();c.set(l,f);f+=l.byteLength}if(on.ts.videoPacketContainsKeyFrame(c)){var m=on.ts.parsePesTime(c);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(d&&i.firstKeyFrame){break}s+=hn;n+=hn;continue}s++;n++}n=t.byteLength;s=n-hn;d=false;while(s>=0){if(t[s]===un&&t[n]===un){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="video"&&h){u=on.ts.parsePesTime(r);if(u){u.type="video";i.video.push(u);d=true}}break}if(d){break}s-=hn;n-=hn;continue}s--;n--}};var dn=function(t,e){if(t.audio&&t.audio.length){var i=e;if(typeof i==="undefined"||isNaN(i)){i=t.audio[0].dts}t.audio.forEach((function(t){t.dts=rn(t.dts,i);t.pts=rn(t.pts,i);t.dtsTime=t.dts/an;t.ptsTime=t.pts/an}))}if(t.video&&t.video.length){var s=e;if(typeof s==="undefined"||isNaN(s)){s=t.video[0].dts}t.video.forEach((function(t){t.dts=rn(t.dts,s);t.pts=rn(t.pts,s);t.dtsTime=t.dts/an;t.ptsTime=t.pts/an}));if(t.firstKeyFrame){var n=t.firstKeyFrame;n.dts=rn(n.dts,s);n.pts=rn(n.pts,s);n.dtsTime=n.dts/an;n.ptsTime=n.pts/an}}};var pn=function(t){var e=false,i=0,s=null,n=null,r=0,o=0,a;while(t.length-o>=3){var h=on.aac.parseType(t,o);switch(h){case"timed-metadata":if(t.length-o<10){e=true;break}r=on.aac.parseId3TagSize(t,o);if(r>t.length){e=true;break}if(n===null){a=t.subarray(o,o+r);n=on.aac.parseAacTimestamp(a)}o+=r;break;case"audio":if(t.length-o<7){e=true;break}r=on.aac.parseAdtsSize(t,o);if(r>t.length){e=true;break}if(s===null){a=t.subarray(o,o+r);s=on.aac.parseSampleRate(a)}i++;o+=r;break;default:o++;break}if(e){return null}}if(s===null||n===null){return null}var u=an/s;var c={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+i*1024*u,pts:n+i*1024*u}]};return c};var mn=function(t){var e={pid:null,table:null};var i={};cn(t,e);for(var s in e.table){if(e.table.hasOwnProperty(s)){var n=e.table[s];switch(n){case nn.H264_STREAM_TYPE:i.video=[];ln(t,e,i);if(i.video.length===0){delete i.video}break;case nn.ADTS_STREAM_TYPE:i.audio=[];fn(t,e,i);if(i.audio.length===0){delete i.audio}break}}}return i};var vn=function(t,e){var i=on.aac.isLikelyAacData(t);var s;if(i){s=pn(t)}else{s=mn(t)}if(!s||!s.audio&&!s.video){return null}dn(s,e);return s};var gn={inspect:vn,parseAudioPes_:fn};const yn=function(t,e){e.on("data",(function(e){const i=e.initSegment;e.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const s=e.data;e.data=s.buffer;t.postMessage({action:"data",segment:e,byteOffset:s.byteOffset,byteLength:s.byteLength},[e.data])}));e.on("done",(function(e){t.postMessage({action:"done"})}));e.on("gopInfo",(function(e){t.postMessage({action:"gopInfo",gopInfo:e})}));e.on("videoSegmentTimingInfo",(function(e){const i={start:{decode:pt.videoTsToSeconds(e.start.dts),presentation:pt.videoTsToSeconds(e.start.pts)},end:{decode:pt.videoTsToSeconds(e.end.dts),presentation:pt.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:pt.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){i.prependedContentDuration=pt.videoTsToSeconds(e.prependedContentDuration)}t.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}));e.on("audioSegmentTimingInfo",(function(e){const i={start:{decode:pt.videoTsToSeconds(e.start.dts),presentation:pt.videoTsToSeconds(e.start.pts)},end:{decode:pt.videoTsToSeconds(e.end.dts),presentation:pt.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:pt.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){i.prependedContentDuration=pt.videoTsToSeconds(e.prependedContentDuration)}t.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}));e.on("id3Frame",(function(e){t.postMessage({action:"id3Frame",id3Frame:e})}));e.on("caption",(function(e){t.postMessage({action:"caption",caption:e})}));e.on("trackinfo",(function(e){t.postMessage({action:"trackinfo",trackInfo:e})}));e.on("audioTimingInfo",(function(e){t.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:pt.videoTsToSeconds(e.start),end:pt.videoTsToSeconds(e.end)}})}));e.on("videoTimingInfo",(function(e){t.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:pt.videoTsToSeconds(e.start),end:pt.videoTsToSeconds(e.end)}})}));e.on("log",(function(e){t.postMessage({action:"log",log:e})}))};class bn{constructor(t,e){this.options=e||{};this.self=t;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Oi.Transmuxer(this.options);yn(this.self,this.transmuxer)}pushMp4Captions(t){if(!this.captionParser){this.captionParser=new vs;this.captionParser.init()}const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);const i=this.captionParser.parse(e,t.trackIds,t.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:e.buffer},[e.buffer])}probeMp4StartTime({timescales:t,data:e}){const i=Hs.startTime(t,e);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:e},[e.buffer])}probeMp4Tracks({data:t}){const e=Hs.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:t},[t.buffer])}probeEmsgID3({data:t,offset:e}){const i=Hs.getEmsgID3(t,e);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:t},[t.buffer])}probeTs({data:t,baseStartTime:e}){const i=typeof e==="number"&&!isNaN(e)?e*pt.ONE_SECOND_IN_TS:void 0;const s=gn.inspect(t,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:t},[t.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(t){const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(e)}reset(){this.transmuxer.reset()}setTimestampOffset(t){const e=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(pt.secondsToVideoTs(e)))}setAudioAppendStart(t){this.transmuxer.setAudioAppendStart(Math.ceil(pt.secondsToVideoTs(t.appendStart)))}setRemux(t){this.transmuxer.setRemux(t.remux)}flush(t){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())}}self.onmessage=function(t){if(t.data.action==="init"&&t.data.options){this.messageHandlers=new bn(self,t.data.options);return}if(!this.messageHandlers){this.messageHandlers=new bn(self)}if(t.data&&t.data.action&&t.data.action!=="init"){if(this.messageHandlers[t.data.action]){this.messageHandlers[t.data.action](t.data)}}}})));var up=rp(hp);const cp=(t,e,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:o,metadata:a,videoFrameDtsTime:h,videoFramePtsTime:u}=t.data.segment;e.buffer.push({captions:r,captionStreams:o,metadata:a});const c=t.data.segment.boxes||{data:t.data.segment.data};const f={type:s,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};if(typeof h!=="undefined"){f.videoFrameDtsTime=h}if(typeof u!=="undefined"){f.videoFramePtsTime=u}i(f)};const fp=({transmuxedData:t,callback:e})=>{t.buffer=[];e(t)};const lp=(t,e)=>{e.gopInfo=t.data.gopInfo};const dp=t=>{const{transmuxer:e,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:o,onTrackInfo:a,onAudioTimingInfo:h,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:f,onId3:l,onCaptions:d,onDone:p,onEndedTimeline:m,onTransmuxerLog:v,isEndOfTimeline:g}=t;const y={buffer:[]};let b=g;const w=i=>{if(e.currentTransmux!==t){return}if(i.data.action==="data"){cp(i,y,o)}if(i.data.action==="trackinfo"){a(i.data.trackInfo)}if(i.data.action==="gopInfo"){lp(i,y)}if(i.data.action==="audioTimingInfo"){h(i.data.audioTimingInfo)}if(i.data.action==="videoTimingInfo"){u(i.data.videoTimingInfo)}if(i.data.action==="videoSegmentTimingInfo"){c(i.data.videoSegmentTimingInfo)}if(i.data.action==="audioSegmentTimingInfo"){f(i.data.audioSegmentTimingInfo)}if(i.data.action==="id3Frame"){l([i.data.id3Frame],i.data.id3Frame.dispatchType)}if(i.data.action==="caption"){d(i.data.caption)}if(i.data.action==="endedtimeline"){b=false;m()}if(i.data.action==="log"){v(i.data.log)}if(i.data.type!=="transmuxed"){return}if(b){return}e.onmessage=null;fp({transmuxedData:y,callback:p});pp(e)};e.onmessage=w;if(s){e.postMessage({action:"setAudioAppendStart",appendStart:s})}if(Array.isArray(n)){e.postMessage({action:"alignGopsWith",gopsToAlignWith:n})}if(typeof r!=="undefined"){e.postMessage({action:"setRemux",remux:r})}if(i.byteLength){const t=i instanceof ArrayBuffer?i:i.buffer;const s=i instanceof ArrayBuffer?0:i.byteOffset;e.postMessage({action:"push",data:t,byteOffset:s,byteLength:i.byteLength},[t])}if(g){e.postMessage({action:"endTimeline"})}e.postMessage({action:"flush"})};const pp=t=>{t.currentTransmux=null;if(t.transmuxQueue.length){t.currentTransmux=t.transmuxQueue.shift();if(typeof t.currentTransmux==="function"){t.currentTransmux()}else{dp(t.currentTransmux)}}};const mp=(t,e)=>{t.postMessage({action:e});pp(t)};const vp=(t,e)=>{if(!e.currentTransmux){e.currentTransmux=t;mp(e,t);return}e.transmuxQueue.push(mp.bind(null,e,t))};const gp=t=>{vp("reset",t)};const yp=t=>{vp("endTimeline",t)};const bp=t=>{if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t;dp(t);return}t.transmuxer.transmuxQueue.push(t)};const wp=t=>{const e=new up;e.currentTransmux=null;e.transmuxQueue=[];const i=e.terminate;e.terminate=()=>{e.currentTransmux=null;e.transmuxQueue.length=0;return i.call(e)};e.postMessage({action:"init",options:t});return e};var Tp={reset:gp,endTimeline:yp,transmux:bp,createTransmuxer:wp};const Sp=function(t){const e=t.transmuxer;const i=t.endAction||t.action;const s=t.callback;const n=g({},t,{endAction:null,transmuxer:null,callback:null});const r=n=>{if(n.data.action!==i){return}e.removeEventListener("message",r);if(n.data.data){n.data.data=new Uint8Array(n.data.data,t.byteOffset||0,t.byteLength||n.data.data.byteLength);if(t.data){t.data=n.data.data}}s(n.data)};e.addEventListener("message",r);if(t.data){const i=t.data instanceof ArrayBuffer;n.byteOffset=i?0:t.data.byteOffset;n.byteLength=t.data.byteLength;const s=[i?t.data:t.data.buffer];e.postMessage(n,s)}else{e.postMessage(n)}};const kp={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const Ep=t=>{t.forEach((t=>{t.abort()}))};const Ip=t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0});const xp=t=>{const e=t.target;const i=Date.now()-e.requestTime;const s={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};s.bytesReceived=t.loaded;s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3);return s};const Ap=(t,e)=>{if(e.timedout){return{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:kp.TIMEOUT,xhr:e}}if(e.aborted){return{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:kp.ABORTED,xhr:e}}if(t){return{status:e.status,message:"HLS request errored at URL: "+e.uri,code:kp.FAILURE,xhr:e}}if(e.responseType==="arraybuffer"&&e.response.byteLength===0){return{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:kp.FAILURE,xhr:e}}return null};const Dp=(t,e,i)=>(s,n)=>{const r=n.response;const o=Ap(s,n);if(o){return i(o,t)}if(r.byteLength!==16){return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:kp.FAILURE,xhr:n},t)}const a=new DataView(r);const h=new Uint32Array([a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12)]);for(let t=0;t<e.length;t++){e[t].bytes=h}return i(null,t)};const Cp=(t,e)=>{const i=Xr(t.map.bytes);if(i!=="mp4"){const s=t.map.resolvedUri||t.map.uri;return e({internal:true,message:`Found unsupported ${i||"unknown"} container for initialization segment at URL: ${s}`,code:kp.FAILURE})}Sp({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:({tracks:i,data:s})=>{t.map.bytes=s;i.forEach((function(e){t.map.tracks=t.map.tracks||{};if(t.map.tracks[e.type]){return}t.map.tracks[e.type]=e;if(typeof e.id==="number"&&e.timescale){t.map.timescales=t.map.timescales||{};t.map.timescales[e.id]=e.timescale}}));return e(null)}})};const jp=({segment:t,finishProcessingFn:e})=>(i,s)=>{const n=Ap(i,s);if(n){return e(n,t)}const r=new Uint8Array(s.response);if(t.map.key){t.map.encryptedBytes=r;return e(null,t)}t.map.bytes=r;Cp(t,(function(i){if(i){i.xhr=s;i.status=s.status;return e(i,t)}e(null,t)}))};const _p=({segment:t,finishProcessingFn:e,responseType:i})=>(s,n)=>{const r=Ap(s,n);if(r){return e(r,t)}const o=i==="arraybuffer"||!n.responseText?n.response:ip(n.responseText.substring(t.lastReachedChar||0));t.stats=Ip(n);if(t.key){t.encryptedBytes=new Uint8Array(o)}else{t.bytes=new Uint8Array(o)}return e(null,t)};const Np=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})=>{const d=t.map&&t.map.tracks||{};const p=Boolean(d.audio&&d.video);let m=s.bind(null,t,"audio","start");const v=s.bind(null,t,"audio","end");let g=s.bind(null,t,"video","start");const y=s.bind(null,t,"video","end");const b=()=>bp({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:p,onData:e=>{e.type=e.type==="combined"?"video":e.type;c(t,e)},onTrackInfo:e=>{if(i){if(p){e.isMuxed=true}i(t,e)}},onAudioTimingInfo:t=>{if(m&&typeof t.start!=="undefined"){m(t.start);m=null}if(v&&typeof t.end!=="undefined"){v(t.end)}},onVideoTimingInfo:t=>{if(g&&typeof t.start!=="undefined"){g(t.start);g=null}if(y&&typeof t.end!=="undefined"){y(t.end)}},onVideoSegmentTimingInfo:t=>{n(t)},onAudioSegmentTimingInfo:t=>{r(t)},onId3:(e,i)=>{o(t,e,i)},onCaptions:e=>{a(t,[e])},isEndOfTimeline:h,onEndedTimeline:()=>{u()},onTransmuxerLog:l,onDone:e=>{if(!f){return}e.type=e.type==="combined"?"video":e.type;f(null,t,e)}});Sp({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:s=>{t.bytes=e=s.data;const n=s.result;if(n){i(t,{hasAudio:n.hasAudio,hasVideo:n.hasVideo,isMuxed:p});i=null;if(n.hasAudio&&!p){m(n.audioStart)}if(n.hasVideo){g(n.videoStart)}m=null;g=null}b()}})};const Mp=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})=>{let d=new Uint8Array(e);if(Gr(d)){t.isFmp4=true;const{tracks:n}=t.map;const r={isFmp4:true,hasVideo:!!n.video,hasAudio:!!n.audio};if(n.audio&&n.audio.codec&&n.audio.codec!=="enca"){r.audioCodec=n.audio.codec}if(n.video&&n.video.codec&&n.video.codec!=="encv"){r.videoCodec=n.video.codec}if(n.video&&n.audio){r.isMuxed=true}i(t,r);const h=(e,i)=>{c(t,{data:d,type:r.hasAudio&&!r.isMuxed?"audio":"video"});if(i&&i.length){o(t,i)}if(e&&e.length){a(t,e)}f(null,t,{})};Sp({action:"probeMp4StartTime",timescales:t.map.timescales,data:d,transmuxer:t.transmuxer,callback:({data:i,startTime:o})=>{e=i.buffer;t.bytes=d=i;if(r.hasAudio&&!r.isMuxed){s(t,"audio","start",o)}if(r.hasVideo){s(t,"video","start",o)}Sp({action:"probeEmsgID3",data:d,transmuxer:t.transmuxer,offset:o,callback:({emsgData:s,id3Frames:r})=>{e=s.buffer;t.bytes=d=s;if(!n.video||!i.byteLength||!t.transmuxer){h(undefined,r);return}Sp({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:d,timescales:t.map.timescales,trackIds:[n.video.id],callback:i=>{e=i.data.buffer;t.bytes=d=i.data;i.logs.forEach((function(t){l(cl(t,{stream:"mp4CaptionParser"}))}));h(i.captions,r)}})}})}});return}if(!t.transmuxer){f(null,t,{});return}if(typeof t.container==="undefined"){t.container=Xr(d)}if(t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:false,hasVideo:false});f(null,t,{});return}Np({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})};const Op=function({id:t,key:e,encryptedBytes:i,decryptionWorker:s},n){const r=e=>{if(e.data.source===t){s.removeEventListener("message",r);const t=e.data.decrypted;n(new Uint8Array(t.bytes,t.byteOffset,t.byteLength))}};s.addEventListener("message",r);let o;if(e.bytes.slice){o=e.bytes.slice()}else{o=new Uint32Array(Array.prototype.slice.call(e.bytes))}s.postMessage(Ad({source:t,encrypted:i,key:o,iv:e.iv}),[i.buffer,o.buffer])};const Lp=({decryptionWorker:t,segment:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})=>{Op({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t},(t=>{e.bytes=t;Mp({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})}))};const Rp=({activeXhrs:t,decryptionWorker:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})=>{let d=0;let p=false;return(m,v)=>{if(p){return}if(m){p=true;Ep(t);return f(m,v)}d+=1;if(d===t.length){const d=function(){if(v.encryptedBytes){return Lp({decryptionWorker:e,segment:v,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})}Mp({segment:v,bytes:v.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c,doneFn:f,onTransmuxerLog:l})};v.endOfAllRequests=Date.now();if(v.map&&v.map.encryptedBytes&&!v.map.bytes){return Op({decryptionWorker:e,id:v.requestId+"-init",encryptedBytes:v.map.encryptedBytes,key:v.map.key},(e=>{v.map.bytes=e;Cp(v,(e=>{if(e){Ep(t);return f(e,v)}d()}))}))}d()}}};const $p=({loadendState:t,abortFn:e})=>i=>{const s=i.target;if(s.aborted&&e&&!t.calledAbortFn){e();t.calledAbortFn=true}};const Pp=({segment:t,progressFn:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:u,dataFn:c})=>i=>{const s=i.target;if(s.aborted){return}t.stats=cl(t.stats,xp(i));if(!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived){t.stats.firstBytesReceivedAt=Date.now()}return e(i,t)};const Up=({xhr:t,xhrOptions:e,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:f,isEndOfTimeline:l,endedTimelineFn:d,dataFn:p,doneFn:m,onTransmuxerLog:v})=>{const g=[];const y=Rp({activeXhrs:g,decryptionWorker:i,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:f,isEndOfTimeline:l,endedTimelineFn:d,dataFn:p,doneFn:m,onTransmuxerLog:v});if(s.key&&!s.key.bytes){const i=[s.key];if(s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri){i.push(s.map.key)}const n=cl(e,{uri:s.key.resolvedUri,responseType:"arraybuffer"});const r=Dp(s,i,y);const o=t(n,r);g.push(o)}if(s.map&&!s.map.bytes){const i=s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri);if(i){const i=cl(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"});const n=Dp(s,[s.map.key],y);const r=t(i,n);g.push(r)}const n=cl(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:kd(s.map)});const r=jp({segment:s,finishProcessingFn:y});const o=t(n,r);g.push(o)}const b=cl(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:kd(s)});const w=_p({segment:s,finishProcessingFn:y,responseType:b.responseType});const T=t(b,w);T.addEventListener("progress",Pp({segment:s,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:f,isEndOfTimeline:l,endedTimelineFn:d,dataFn:p}));g.push(T);const S={};g.forEach((t=>{t.addEventListener("loadend",$p({loadendState:S,abortFn:n}))}));return()=>Ep(g)};const Fp=ul("CodecUtils");const Bp=function(t){const e=t.attributes||{};if(e.CODECS){return Pt(e.CODECS)}};const qp=(t,e)=>{const i=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&i.AUDIO&&t.mediaGroups.AUDIO[i.AUDIO]};const Vp=(t,e)=>{if(!qp(t,e)){return true}const i=e.attributes||{};const s=t.mediaGroups.AUDIO[i.AUDIO];for(const t in s){if(!s[t].uri&&!s[t].playlists){return true}}return false};const Hp=function(t){const e={};t.forEach((({mediaType:t,type:i,details:s})=>{e[t]=e[t]||[];e[t].push($t(`${i}${s}`))}));Object.keys(e).forEach((function(t){if(e[t].length>1){Fp(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);e[t]=null;return}e[t]=e[t][0]}));return e};const zp=function(t){let e=0;if(t.audio){e++}if(t.video){e++}return e};const Xp=function(t,e){const i=e.attributes||{};const s=Hp(Bp(e)||[]);if(qp(t,e)&&!s.audio){if(!Vp(t,e)){const e=Hp(Ut(t,i.AUDIO)||[]);if(e.audio){s.audio=e.audio}}}return s};const Gp=ul("PlaylistSelector");const Wp=function(t){if(!t||!t.playlist){return}const e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})};const Yp=function(t,e){if(!t){return""}const i=o.getComputedStyle(t);if(!i){return""}return i[e]};const Kp=function(t,e){const i=t.slice();t.sort((function(t,s){const n=e(t,s);if(n===0){return i.indexOf(t)-i.indexOf(s)}return n}))};const Qp=function(t,e){let i;let s;if(t.attributes.BANDWIDTH){i=t.attributes.BANDWIDTH}i=i||o.Number.MAX_VALUE;if(e.attributes.BANDWIDTH){s=e.attributes.BANDWIDTH}s=s||o.Number.MAX_VALUE;return i-s};const Jp=function(t,e){let i;let s;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){i=t.attributes.RESOLUTION.width}i=i||o.Number.MAX_VALUE;if(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width){s=e.attributes.RESOLUTION.width}s=s||o.Number.MAX_VALUE;if(i===s&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-e.attributes.BANDWIDTH}return i-s};let Zp=function(t,e,i,s,n,r){if(!t){return}const a={bandwidth:e,width:i,height:s,limitRenditionByPlayerDimensions:n};let h=t.playlists;if(Yl.isAudioOnly(t)){h=r.getAudioTrackPlaylists_();a.audioOnly=true}let u=h.map((t=>{let e;const i=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;const s=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;e=t.attributes&&t.attributes.BANDWIDTH;e=e||o.Number.MAX_VALUE;return{bandwidth:e,width:i,height:s,playlist:t}}));Kp(u,((t,e)=>t.bandwidth-e.bandwidth));u=u.filter((t=>!Yl.isIncompatible(t.playlist)));let c=u.filter((t=>Yl.isEnabled(t.playlist)));if(!c.length){c=u.filter((t=>!Yl.isDisabled(t.playlist)))}const f=c.filter((t=>t.bandwidth*ep.BANDWIDTH_VARIANCE<e));let l=f[f.length-1];const d=f.filter((t=>t.bandwidth===l.bandwidth))[0];if(n===false){const t=d||c[0]||u[0];if(t&&t.playlist){let e="sortedPlaylistReps";if(d){e="bandwidthBestRep"}if(c[0]){e="enabledPlaylistReps"}Gp(`choosing ${Wp(t)} using ${e} with options`,a);return t.playlist}Gp("could not choose a playlist with options",a);return null}const p=f.filter((t=>t.width&&t.height));Kp(p,((t,e)=>t.width-e.width));const m=p.filter((t=>t.width===i&&t.height===s));l=m[m.length-1];const v=m.filter((t=>t.bandwidth===l.bandwidth))[0];let g;let y;let b;if(!v){g=p.filter((t=>t.width>i||t.height>s));y=g.filter((t=>t.width===g[0].width&&t.height===g[0].height));l=y[y.length-1];b=y.filter((t=>t.bandwidth===l.bandwidth))[0]}let w;if(r.leastPixelDiffSelector){const t=p.map((t=>{t.pixelDiff=Math.abs(t.width-i)+Math.abs(t.height-s);return t}));Kp(t,((t,e)=>{if(t.pixelDiff===e.pixelDiff){return e.bandwidth-t.bandwidth}return t.pixelDiff-e.pixelDiff}));w=t[0]}const T=w||b||v||d||c[0]||u[0];if(T&&T.playlist){let t="sortedPlaylistReps";if(w){t="leastPixelDiffRep"}else if(b){t="resolutionPlusOneRep"}else if(v){t="resolutionBestRep"}else if(d){t="bandwidthBestRep"}else if(c[0]){t="enabledPlaylistReps"}Gp(`choosing ${Wp(T)} using ${t} with options`,a);return T.playlist}Gp("could not choose a playlist with options",a);return null};const tm=function(){const t=this.useDevicePixelRatio?o.devicePixelRatio||1:1;return Zp(this.playlists.main,this.systemBandwidth,parseInt(Yp(this.tech_.el(),"width"),10)*t,parseInt(Yp(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.playlistController_)};const em=function(t){let e=-1;let i=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){const s=this.useDevicePixelRatio?o.devicePixelRatio||1:1;if(e<0){e=this.systemBandwidth;i=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==i){e=t*this.systemBandwidth+(1-t)*e;i=this.systemBandwidth}return Zp(this.playlists.main,e,parseInt(Yp(this.tech_.el(),"width"),10)*s,parseInt(Yp(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const im=function(t){const{main:e,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:o,currentTimeline:a,syncController:h}=t;const u=e.playlists.filter((t=>!Yl.isIncompatible(t)));let c=u.filter(Yl.isEnabled);if(!c.length){c=u.filter((t=>!Yl.isDisabled(t)))}const f=c.filter(Yl.hasAttribute.bind(null,"BANDWIDTH"));const l=f.map((t=>{const e=h.getSyncPoint(t,n,a,i);const u=e?1:2;const c=Yl.estimateSegmentRequestTime(r,s,t);const f=c*u-o;return{playlist:t,rebufferingImpact:f}}));const d=l.filter((t=>t.rebufferingImpact<=0));Kp(d,((t,e)=>Qp(e.playlist,t.playlist)));if(d.length){return d[0]}Kp(l,((t,e)=>t.rebufferingImpact-e.rebufferingImpact));return l[0]||null};const sm=function(){const t=this.playlists.main.playlists.filter(Yl.isEnabled);Kp(t,((t,e)=>Qp(t,e)));const e=t.filter((t=>!!Xp(this.playlists.main,t).video));return e[0]||null};const nm=t=>{let e=0;let i;if(t.bytes){i=new Uint8Array(t.bytes);t.segments.forEach((t=>{i.set(t,e);e+=t.byteLength}))}return i};const rm=function(t,e,i){if(!t[i]){e.trigger({type:"usage",name:"vhs-608"});let s=i;if(/^cc708_/.test(i)){s="SERVICE"+i.split("_")[1]}const n=e.textTracks().getTrackById(s);if(n){t[i]=n}else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let r=i;let o=i;let a=false;const h=n[s];if(h){r=h.label;o=h.language;a=h.default}t[i]=e.addRemoteTextTrack({kind:"captions",id:s,default:a,label:r,language:o},false).track}}};const om=function({inbandTextTracks:t,captionArray:e,timestampOffset:i}){if(!e){return}const s=o.WebKitDataCue||o.VTTCue;e.forEach((e=>{const n=e.stream;if(e.content){e.content.forEach((r=>{const o=new s(e.startTime+i,e.endTime+i,r.text);o.line=r.line;o.align="left";o.position=r.position;o.positionAlign="line-left";t[n].addCue(o)}))}else{t[n].addCue(new s(e.startTime+i,e.endTime+i,e.text))}}))};const am=function(t){Object.defineProperties(t.frame,{id:{get(){el.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return t.value.key}},value:{get(){el.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return t.value.data}},privateData:{get(){el.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return t.value.data}}})};const hm=({inbandTextTracks:t,metadataArray:e,timestampOffset:i,videoDuration:s})=>{if(!e){return}const n=o.WebKitDataCue||o.VTTCue;const r=t.metadataTrack_;if(!r){return}e.forEach((t=>{const e=t.cueTime+i;if(typeof e!=="number"||o.isNaN(e)||e<0||!(e<Infinity)){return}if(!t.frames||!t.frames.length){return}t.frames.forEach((t=>{const i=new n(e,e,t.value||t.url||t.data||"");i.frame=t;i.value=t;am(i);r.addCue(i)}))}));if(!r.cues||!r.cues.length){return}const a=r.cues;const h=[];for(let t=0;t<a.length;t++){if(a[t]){h.push(a[t])}}const u=h.reduce(((t,e)=>{const i=t[e.startTime]||[];i.push(e);t[e.startTime]=i;return t}),{});const c=Object.keys(u).sort(((t,e)=>Number(t)-Number(e)));c.forEach(((t,e)=>{const i=u[t];const n=isFinite(s)?s:0;const r=Number(c[e+1])||n;i.forEach((t=>{t.endTime=r}))}))};const um={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 fm=({inbandTextTracks:t,dateRanges:e})=>{const i=t.metadataTrack_;if(!i){return}const s=o.WebKitDataCue||o.VTTCue;e.forEach((t=>{for(const e of Object.keys(t)){if(cm.has(e)){continue}const n=new s(t.startTime,t.endTime,"");n.id=t.id;n.type="com.apple.quicktime.HLS";n.value={key:um[e],data:t[e]};if(e==="scte35Out"||e==="scte35In"){n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer}i.addCue(n)}t.processDateRange()}))};const lm=(t,e,i)=>{if(t.metadataTrack_){return}t.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;if(!el.browser.IS_ANY_SAFARI){t.metadataTrack_.inBandMetadataTrackDispatchType=e}};const dm=function(t,e,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>=t&&n.endTime<=e){i.removeCue(n)}}};const pm=function(t){const e=t.cues;if(!e){return}const i={};for(let s=e.length-1;s>=0;s--){const n=e[s];const r=`${n.startTime}-${n.endTime}-${n.text}`;if(i[r]){t.removeCue(n)}else{i[r]=n}}};const mm=(t,e,i)=>{if(typeof e==="undefined"||e===null||!t.length){return[]}const s=Math.ceil((e-i+3)*io.ONE_SECOND_IN_TS);let n;for(n=0;n<t.length;n++){if(t[n].pts>s){break}}return t.slice(n)};const vm=(t,e,i)=>{if(!e.length){return t}if(i){return e.slice()}const s=e[0].pts;let n=0;for(n;n<t.length;n++){if(t[n].pts>=s){break}}return t.slice(0,n).concat(e)};const gm=(t,e,i,s)=>{const n=Math.ceil((e-s)*io.ONE_SECOND_IN_TS);const r=Math.ceil((i-s)*io.ONE_SECOND_IN_TS);const o=t.slice();let a=t.length;while(a--){if(t[a].pts<=r){break}}if(a===-1){return o}let h=a+1;while(h--){if(t[h].pts<=n){break}}h=Math.max(h,0);o.splice(h,a-h+1);return o};const ym=function(t,e){if(!t&&!e||!t&&e||t&&!e){return false}if(t===e){return true}const i=Object.keys(t).sort();const s=Object.keys(e).sort();if(i.length!==s.length){return false}for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n]){return false}if(t[r]!==e[r]){return false}}return true};const bm=22;const wm=function(t,e,i){e=e||[];const s=[];let n=0;for(let r=0;r<e.length;r++){const o=e[r];if(t===o.timeline){s.push(r);n+=o.duration;if(n>i){return r}}}if(s.length===0){return 0}return s[s.length-1]};const Tm=1;const Sm=500;const km=t=>typeof t==="number"&&isFinite(t);const Em=1/60;const Im=(t,e,i)=>{if(t!=="main"||!e||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(e.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(!e.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 xm=(t,e,i)=>{let s=e-ep.BACK_BUFFER_LENGTH;if(t.length){s=Math.max(s,t.start(0))}const n=e-i;return Math.min(n,s)};const Am=t=>{const{startOfSegment:e,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:o,segments:a=[]},mediaIndex:h,partIndex:u,timeline:c}=t;const f=a.length-1;let l="mediaIndex/partIndex increment";if(t.getMediaInfoForTime){l=`getMediaInfoForTime (${t.getMediaInfoForTime})`}else if(t.isSyncRequest){l="getSyncSegmentCandidate (isSyncRequest)"}if(t.independent){l+=` with independent ${t.independent}`}const d=typeof u==="number";const p=t.segment.uri?"segment":"pre-segment";const m=d?Dl({preloadSegment:s})-1:0;return`${p} [${r+h}/${r+f}]`+(d?` part [${u}/${m}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(d?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${e}]`+` duration [${i}]`+` timeline [${c}]`+` selected by [${l}]`+` playlist [${o}]`};const Dm=t=>`${t}TimingInfo`;const Cm=({segmentTimeline:t,currentTimeline:e,startOfSegment:i,buffered:s,overrideCheck:n})=>{if(!n&&t===e){return null}if(t<e){return i}return s.length?s.end(s.length-1):i};const jm=({timelineChangeController:t,currentTimeline:e,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(e===i){return false}if(s==="audio"){const e=t.lastTimelineChange({type:"main"});return!e||e.to!==i}if(s==="main"&&n){const e=t.pendingTimelineChange({type:"audio"});if(e&&e.to===i){return false}return true}return false};const _m=t=>{let e=0;["video","audio"].forEach((function(i){const s=t[`${i}TimingInfo`];if(!s){return}const{start:n,end:r}=s;let a;if(typeof n==="bigint"||typeof r==="bigint"){a=o.BigInt(r)-o.BigInt(n)}else if(typeof n==="number"&&typeof r==="number"){a=r-n}if(typeof a!=="undefined"&&a>e){e=a}}));if(typeof e==="bigint"&&e<Number.MAX_SAFE_INTEGER){e=Number(e)}return e};const Nm=({segmentDuration:t,maxDuration:e})=>{if(!t){return false}return Math.round(t)>e+ll};const Mm=(t,e)=>{if(e!=="hls"){return null}const i=_m({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!i){return null}const s=t.playlist.targetDuration;const n=Nm({segmentDuration:i,maxDuration:s*2});const r=Nm({segmentDuration:i,maxDuration:s});const o=`Segment with index ${t.mediaIndex} `+`from playlist ${t.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${t.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:o}}return null};class Om extends el.EventTarget{constructor(t,e={}){super();if(!t){throw new TypeError("Initialization settings are required")}if(typeof t.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!t.mediaSource){throw new TypeError("No MediaSource specified")}this.bandwidth=t.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.mediaIndex=null;this.partIndex=null;this.hasPlayed_=t.hasPlayed;this.currentTime_=t.currentTime;this.seekable_=t.seekable;this.seeking_=t.seeking;this.duration_=t.duration;this.mediaSource_=t.mediaSource;this.vhs_=t.vhs;this.loaderType_=t.loaderType;this.currentMediaInfo_=void 0;this.startingMediaInfo_=void 0;this.segmentMetadataTrack_=t.segmentMetadataTrack;this.goalBufferLength_=t.goalBufferLength;this.sourceType_=t.sourceType;this.sourceUpdater_=t.sourceUpdater;this.inbandTextTracks_=t.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=t.timelineChangeController;this.shouldSaveSegmentTimingInfo_=true;this.parse708captions_=t.parse708captions;this.useDtsForTimestampOffset_=t.useDtsForTimestampOffset;this.captionServices_=t.captionServices;this.exactManifestTimings=t.exactManifestTimings;this.addMetadataToTextTrack=t.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;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_=t.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=t.decrypter;this.syncController_=t.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.replaceSegmentsUntil_=-1;this.logger_=ul(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(t){if(t!==this.state_){this.logger_(`${this.state_} -> ${t}`);this.state_=t;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",(()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}));if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",(()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}))}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",(()=>{if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}))}}createTransmuxer_(){return Tp.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_){o.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(t){this.audioDisabled_=!t;if(t){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;o.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(t){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==t){return true}return false}error(t){if(typeof t!=="undefined"){this.logger_("error occurred:",t);this.error_=t}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){Tp.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t){return fl()}if(this.loaderType_==="main"){const{hasAudio:e,hasVideo:i,isMuxed:s}=t;if(i&&e&&!this.audioDisabled_&&!s){return this.sourceUpdater_.buffered()}if(i){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(t,e=false){if(!t){return null}const i=Dd(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}}return s||t}segmentKey(t,e=false){if(!t){return null}const i=Cd(t);let s=this.keyCache_[i];if(this.cacheEncryptionKeys_&&e&&!s&&t.bytes){this.keyCache_[i]=s={resolvedUri:t.resolvedUri,bytes:t.bytes}}const n={resolvedUri:(s||t).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(t,e={}){if(!t){return}const i=this.playlist_;const s=this.pendingSegment_;this.playlist_=t;this.xhrOptions_=e;if(this.state==="INIT"){t.syncInfo={mediaSequence:t.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(t)}}let n=null;if(i){if(i.id){n=i.id}else if(i.uri){n=i.uri}}this.logger_(`playlist update [${n} => ${t.id||t.uri}]`);this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==t.uri){if(this.mediaIndex!==null){const e=!t.endList&&typeof t.partTargetDuration==="number";if(e){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=t.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 t=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!t.parts||!t.parts.length||!t.parts[this.partIndex])){const t=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=t}}}if(s){s.mediaIndex-=r;if(s.mediaIndex<0){s.mediaIndex=null;s.partIndex=null}else{if(s.mediaIndex>=0){s.segment=t.segments[s.mediaIndex]}if(s.partIndex>=0&&s.segment.parts){s.part=s.segment.parts[s.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,t)}pause(){if(this.checkBufferTimeout_){o.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetLoaderProperties(){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true}}resetEverything(t){this.resetLoaderProperties();this.resetLoader();this.remove(0,Infinity,t);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;this.resyncLoader()}resyncLoader(){if(this.transmuxer_){Tp.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(t,e,i=(()=>{}),s=false){if(e===Infinity){e=this.duration_()}if(e<=t){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(t,e,r)}if(s||this.loaderType_==="main"){this.gopBuffer_=gm(this.gopBuffer_,t,e,this.timeMapping_);n++;this.sourceUpdater_.removeVideo(t,e,r)}for(const i in this.inbandTextTracks_){dm(t,e,this.inbandTextTracks_[i])}dm(t,e,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){o.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=o.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){o.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=o.setTimeout(this.monitorBufferTick_.bind(this),Sm)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const t=this.chooseNextRequest_();if(!t){return}if(typeof t.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline})}this.loadSegment_(t)}isEndOfStream_(t=this.mediaIndex,e=this.playlist_,i=this.partIndex){if(!e||!this.mediaSource_){return false}const s=typeof t==="number"&&e.segments[t];const n=t+1===e.segments.length;const r=!s||!s.parts||i+1===s.parts.length;return e.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const t=this.buffered_();const e=kl(t)||0;const i=El(t,this.currentTime_());const s=!this.hasPlayed_()&&i>=1;const n=i>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||s||n){return null}this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(o.isSyncRequest){o.mediaIndex=wm(this.currentTimeline_,r,e)}else if(this.mediaIndex!==null){const t=r[this.mediaIndex];const i=typeof this.partIndex==="number"?this.partIndex:-1;o.startOfSegment=t.end?t.end:e;if(t.parts&&t.parts[i+1]){o.mediaIndex=this.mediaIndex;o.partIndex=i+1}else{o.mediaIndex=this.mediaIndex+1}}else{const{segmentIndex:t,startTime:i,partIndex:s}=Yl.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${e}`:`currentTime ${this.currentTime_()}`;o.mediaIndex=t;o.startOfSegment=i;o.partIndex=s}const a=r[o.mediaIndex];let h=a&&typeof o.partIndex==="number"&&a.parts&&a.parts[o.partIndex];if(!a||typeof o.partIndex==="number"&&!h){return null}if(typeof o.partIndex!=="number"&&a.parts){o.partIndex=0;h=a.parts[0]}const u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&h&&!u&&!h.independent){if(o.partIndex===0){const t=r[o.mediaIndex-1];const e=t.parts&&t.parts.length&&t.parts[t.parts.length-1];if(e&&e.independent){o.mediaIndex-=1;o.partIndex=t.parts.length-1;o.independent="previous segment"}}else if(a.parts[o.partIndex-1].independent){o.partIndex-=1;o.independent="previous part"}}const c=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(o.mediaIndex>=r.length-1&&c&&!this.seeking_()){return null}return this.generateSegmentInfo_(o)}generateSegmentInfo_(t){const{independent:e,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:o,forceTimestampOffset:a,getMediaInfoForTime:h}=t;const u=i.segments[s];const c=typeof o==="number"&&u.parts[o];const f={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:s,partIndex:c?o:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:e};const l=typeof a!=="undefined"?a:this.isPendingTimestampOffset_;f.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:l});const d=kl(this.sourceUpdater_.audioBuffered());if(typeof d==="number"){f.audioAppendStart=d-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){f.gopsToAlignWith=mm(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return f}timestampOffsetForSegment_(t){return Cm(t)}earlyAbortWhenNeeded_(t){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3){return}const e=this.currentTime_();const i=t.bandwidth;const s=this.pendingSegment_.duration;const n=Yl.estimateSegmentRequestTime(s,i,this.playlist_,t.bytesReceived);const r=wl(this.buffered_(),e,this.vhs_.tech_.playbackRate())-1;if(n<=r){return}const o=im({main:this.vhs_.playlists.main,currentTime:e,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o){return}const a=n-r;const h=a-o.rebufferingImpact;let u=.5;if(r<=ll){u=1}if(!o.playlist||o.playlist.uri===this.playlist_.uri||h<u){return}this.bandwidth=o.playlist.attributes.BANDWIDTH*ep.BANDWIDTH_VARIANCE+1;this.trigger("earlyabort")}handleAbort_(t){this.logger_(`Aborting ${Am(t)}`);this.mediaRequestsAborted+=1}handleProgress_(t,e){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}this.trigger("progress")}handleTrackInfo_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(this.checkForIllegalMediaSwitch(e)){return}e=e||{};if(!ym(this.currentMediaInfo_,e)){this.appendInitSegment_={audio:true,video:true};this.startingMediaInfo_=e;this.currentMediaInfo_=e;this.logger_("trackinfo update",e);this.trigger("trackinfo")}if(this.checkForAbort_(t.requestId)){return}this.pendingSegment_.trackInfo=e;if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleTimingInfo_(t,e,i,s){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}const n=this.pendingSegment_;const r=Dm(e);n[r]=n[r]||{};n[r][i]=s;this.logger_(`timinginfo: ${e} - ${i} - ${s}`);if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleCaptions_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(e.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,t,e));return}const s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();const n={};e.forEach((t=>{n[t.stream]=n[t.stream]||{startTime:Infinity,captions:[],endTime:0};const e=n[t.stream];e.startTime=Math.min(e.startTime,t.startTime+s);e.endTime=Math.max(e.endTime,t.endTime+s);e.captions.push(t)}));Object.keys(n).forEach((t=>{const{startTime:e,endTime:i,captions:r}=n[t];const o=this.inbandTextTracks_;this.logger_(`adding cues from ${e} -> ${i} for ${t}`);rm(o,this.vhs_.tech_,t);dm(e,i,o[t]);om({captionArray:r,inbandTextTracks:o,timestampOffset:s})}));if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(t,e,i){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}const s=this.pendingSegment_;if(!s.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,e,i));return}this.addMetadataToTextTrack(i,e,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach((t=>t()));this.metadataQueue_.caption.forEach((t=>t()));this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const t=this.callQueue_;this.callQueue_=[];t.forEach((t=>t()))}processLoadQueue_(){const t=this.loadQueue_;this.loadQueue_=[];t.forEach((t=>t()))}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const t=this.pendingSegment_;if(!t){return false}if(!this.getCurrentMediaInfo_()){return true}if(jm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}getCurrentMediaInfo_(t=this.pendingSegment_){return t&&t.trackInfo||this.currentMediaInfo_}getMediaInfo_(t=this.pendingSegment_){return this.getCurrentMediaInfo_(t)||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 t=this.pendingSegment_;const e=this.getCurrentMediaInfo_();if(!t||!e){return false}const{hasAudio:i,hasVideo:s,isMuxed:n}=e;if(s&&!t.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!n&&!t.audioTimingInfo){return false}if(jm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}handleData_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,t,e));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(t.map){t.map=this.initSegmentForMap(t.map,true);i.segment.map=t.map}if(t.key){this.segmentKey(t.key,true)}i.isFmp4=t.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[Dm(e.type)].start}else{const t=this.getCurrentMediaInfo_();const e=this.loaderType_==="main"&&t&&t.hasVideo;let s;if(e){s=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:e,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,e.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=this.chooseNextRequest_();if(t.mediaIndex!==i.mediaIndex||t.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,e)}updateAppendInitSegmentStatus(t,e){if(this.loaderType_==="main"&&typeof t.timestampOffset==="number"&&!t.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[e]!==t.playlist){this.appendInitSegment_[e]=true}}getInitSegmentAndUpdateState_({type:t,initSegment:e,map:i,playlist:s}){if(i){const t=Dd(i);if(this.activeInitSegmentId_===t){return null}e=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=t}if(e&&this.appendInitSegment_[t]){this.playlistOfLastInitSegment_[t]=s;this.appendInitSegment_[t]=false;this.activeInitSegmentId_=null;return e}return null}handleQuotaExceededError_({segmentInfo:t,type:e,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: "+Tl(n).join(", "))}if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Tl(r).join(", "))}const a=n.length?n.start(0):0;const h=n.length?n.end(n.length-1):0;const u=r.length?r.start(0):0;const c=r.length?r.end(r.length-1):0;if(h-a<=Tm&&c-u<=Tm){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${i.byteLength}, `+`audio buffer: ${Tl(n).join(", ")}, `+`video buffer: ${Tl(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:t,type:e,bytes:i}));const f=this.currentTime_();const l=f-Tm;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${l}`);this.remove(0,l,(()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Tm}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=o.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()}),Tm*1e3)}),true)}handleAppendError_({segmentInfo:t,type:e,bytes:i},s){if(!s){return}if(s.code===bm){this.handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s);this.error(`${e} append of ${i.length}b failed for segment `+`#${t.mediaIndex} in playlist ${t.playlist.id}`);this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:t,type:e,initSegment:i,data:s,bytes:n}){if(!n){const t=[s];let e=s.byteLength;if(i){t.unshift(i);e+=i.byteLength}n=nm({bytes:e,segments:t})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:e,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:t,type:e,bytes:n}))}handleSegmentTimingInfo_(t,e,i){if(!this.pendingSegment_||e!==this.pendingSegment_.requestId){return}const s=this.pendingSegment_.segment;const n=`${t}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_(t,e){const{type:i,data:s}=e;if(!s||!s.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:e.initSegment,playlist:t.playlist,map:t.isFmp4?t.segment.map:null});this.appendToSourceBuffer_({segmentInfo:t,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_()){this.loadQueue_.push((()=>{const e=g({},t,{forceTimestampOffset:true});g(t,this.generateSegmentInfo_(e));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(t)}));return}this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(t){if(this.shouldUpdateTransmuxerTimestampOffset_(t.timestampOffset)){this.gopBuffer_.length=0;t.gopsToAlignWith=[];this.timeMapping_=0;this.transmuxer_.postMessage({action:"reset"});this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t.timestampOffset})}const e=this.createSimplifiedSegmentObj_(t);const i=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex);const s=this.mediaIndex!==null;const n=t.timeline!==this.currentTimeline_&&t.timeline>0;const r=i||s&&n;this.logger_(`Requesting ${Am(t)}`);if(e.map&&!e.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}t.abortRequests=Up({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:e,abortFn:this.handleAbort_.bind(this,t),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",t.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",t.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:i,stream:s})=>{this.logger_(`${Am(t)} logged from transmuxer stream ${s} as a ${i}: ${e}`)}})}trimBackBuffer_(t){const e=xm(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(e>0){this.remove(0,e)}}createSimplifiedSegmentObj_(t){const e=t.segment;const i=t.part;const s={resolvedUri:i?i.resolvedUri:e.resolvedUri,byterange:i?i.byterange:e.byterange,requestId:t.requestId,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,part:t.part};const n=t.playlist.segments[t.mediaIndex-1];if(n&&n.timeline===e.timeline){if(n.videoTimingInfo){s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd}else if(n.audioTimingInfo){s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd}}if(e.key){const i=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);s.key=this.segmentKey(e.key);s.key.iv=i}if(e.map){s.map=this.initSegmentForMap(e.map)}return s}saveTransferStats_(t){this.mediaRequests+=1;if(t){this.mediaBytesTransferred+=t.bytesReceived;this.mediaTransferDuration+=t.roundTripTime}}saveBandwidthRelatedStats_(t,e){this.pendingSegment_.byteLength=e.bytesReceived;if(t<Em){this.logger_(`Ignoring segment's bandwidth because its duration of ${t}`+` is less than the min to record ${Em}`);return}this.bandwidth=e.bandwidth;this.roundTrip=e.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");this.trigger("timeout")}segmentRequestFinished_(t,e,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,t,e,i));return}this.saveTransferStats_(e.stats);if(!this.pendingSegment_){return}if(e.requestId!==this.pendingSegment_.requestId){return}if(t){this.pendingSegment_=null;this.state="READY";if(t.code===kp.ABORTED){return}this.pause();if(t.code===kp.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1;this.error(t);this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats);s.endOfAllRequests=e.endOfAllRequests;if(i.gopInfo){this.gopBuffer_=vm(this.gopBuffer_,i.gopInfo,this.safeAppend_)}this.state="APPENDING";this.trigger("appending");this.waitForAppendsToComplete_(s)}setTimeMapping_(t){const e=this.syncController_.mappingForTimeline(t);if(e!==null){this.timeMapping_=e}}updateMediaSecondsLoaded_(t){if(typeof t.start==="number"&&typeof t.end==="number"){this.mediaSecondsLoaded+=t.end-t.start}else{this.mediaSecondsLoaded+=t.duration}}shouldUpdateTransmuxerTimestampOffset_(t){if(t===null){return false}if(this.loaderType_==="main"&&t!==this.sourceUpdater_.videoTimestampOffset()){return true}if(!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset()){return true}return false}trueSegmentStart_({currentStart:t,playlist:e,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:o,audioTimingInfo:a}){if(typeof t!=="undefined"){return t}if(!r){return a.start}const h=e.segments[i-1];if(i===0||!h||typeof h.start==="undefined"||h.end!==s+n){return s}return o.start}waitForAppendsToComplete_(t){const e=this.getCurrentMediaInfo_(t);if(!e){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}=e;const r=this.loaderType_==="main"&&s;const o=!this.audioDisabled_&&i&&!n;t.waitingOnAppends=0;if(!t.hasAppendedData_){if(!t.timingInfo&&typeof t.timestampOffset==="number"){this.isPendingTimestampOffset_=true}t.timingInfo={start:0};t.waitingOnAppends++;if(!this.isPendingTimestampOffset_){this.updateSourceBufferTimestampOffset_(t);this.processMetadataQueue_()}this.checkAppendsDone_(t);return}if(r){t.waitingOnAppends++}if(o){t.waitingOnAppends++}if(r){this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t))}if(o){this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))}}checkAppendsDone_(t){if(this.checkForAbort_(t.requestId)){return}t.waitingOnAppends--;if(t.waitingOnAppends===0){this.handleAppendsDone_()}}checkForIllegalMediaSwitch(t){const e=Im(this.loaderType_,this.getCurrentMediaInfo_(),t);if(e){this.error({message:e,playlistExclusionDuration:Infinity});this.trigger("error");return true}return false}updateSourceBufferTimestampOffset_(t){if(t.timestampOffset===null||typeof t.timingInfo.start!=="number"||t.changedTimestampOffset||this.loaderType_!=="main"){return}let e=false;t.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t.segment.videoTimingInfo,audioTimingInfo:t.segment.audioTimingInfo,timingInfo:t.timingInfo});t.changedTimestampOffset=true;if(t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()){this.sourceUpdater_.videoTimestampOffset(t.timestampOffset);e=true}if(t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()){this.sourceUpdater_.audioTimestampOffset(t.timestampOffset);e=true}if(e){this.trigger("timestampoffset")}}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t,audioTimingInfo:e,timingInfo:i}){if(!this.useDtsForTimestampOffset_){return i.start}if(t&&typeof t.transmuxedDecodeStart==="number"){return t.transmuxedDecodeStart}if(e&&typeof e.transmuxedDecodeStart==="number"){return e.transmuxedDecodeStart}return i.start}updateTimingInfoEnd_(t){t.timingInfo=t.timingInfo||{};const e=this.getMediaInfo_();const i=this.loaderType_==="main"&&e&&e.hasVideo;const s=i&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;if(!s){return}t.timingInfo.end=typeof s.end==="number"?s.end:s.start+t.duration}handleAppendsDone_(){if(this.pendingSegment_){this.trigger("appendsdone")}if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}const t=this.pendingSegment_;this.updateTimingInfoEnd_(t);if(this.shouldSaveSegmentTimingInfo_){this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:this.loaderType_==="main"})}const e=Mm(t,this.sourceType_);if(e){if(e.severity==="warn"){el.log.warn(e.message)}else{this.logger_(e.message)}}this.recordThroughput_(t);this.pendingSegment_=null;this.state="READY";if(t.isSyncRequest){this.trigger("syncinfoupdate");if(!t.hasAppendedData_){this.logger_(`Throwing away un-appended sync request ${Am(t)}`);return}}this.logger_(`Appended ${Am(t)}`);this.addSegmentMetadataCue_(t);if(this.currentTime_()>=this.replaceSegmentsUntil_){this.replaceSegmentsUntil_=-1;this.fetchAtBuffer_=true}if(this.currentTimeline_!==t.timeline){this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline});if(this.loaderType_==="main"&&!this.audioDisabled_){this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})}}this.currentTimeline_=t.timeline;this.trigger("syncinfoupdate");const i=t.segment;const s=t.part;const n=i.end&&this.currentTime_()-i.end>t.playlist.targetDuration*3;const r=s&&s.end&&this.currentTime_()-s.end>t.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${Am(t)}`);this.resetEverything();return}const o=this.mediaIndex!==null;if(o){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=t.mediaIndex;this.partIndex=t.partIndex;if(this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)){this.endOfStream()}this.trigger("appended");if(t.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(t){if(t.duration<Em){this.logger_(`Ignoring segment's throughput because its duration of ${t.duration}`+` is less than the min to record ${Em}`);return}const e=this.throughput.rate;const i=Date.now()-t.endOfAllRequests+1;const s=Math.floor(t.byteLength/i*8*1e3);this.throughput.rate+=(s-e)/++this.throughput.count}addSegmentMetadataCue_(t){if(!this.segmentMetadataTrack_){return}const e=t.segment;const i=e.start;const s=e.end;if(!km(i)||!km(s)){return}dm(i,s,this.segmentMetadataTrack_);const n=o.WebKitDataCue||o.VTTCue;const r={custom:e.custom,dateTimeObject:e.dateTimeObject,dateTimeString:e.dateTimeString,programDateTime:e.programDateTime,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:i,end:s};const a=JSON.stringify(r);const h=new n(i,s,a);h.value=r;this.segmentMetadataTrack_.addCue(h)}set replaceSegmentsUntil(t){this.logger_(`Replacing currently buffered segments until ${t}`);this.replaceSegmentsUntil_=t}}function Lm(){}const Rm=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toUpperCase()))};const $m=["video","audio"];const Pm=(t,e)=>{const i=e[`${t}Buffer`];return i&&i.updating||e.queuePending[t]};const Um=(t,e)=>{for(let i=0;i<e.length;i++){const s=e[i];if(s.type==="mediaSource"){return null}if(s.type===t){return i}}return null};const Fm=(t,e)=>{if(e.queue.length===0){return}let i=0;let s=e.queue[i];if(s.type==="mediaSource"){if(!e.updating()&&e.mediaSource.readyState!=="closed"){e.queue.shift();s.action(e);if(s.doneFn){s.doneFn()}Fm("audio",e);Fm("video",e)}return}if(t==="mediaSource"){return}if(!e.ready()||e.mediaSource.readyState==="closed"||Pm(t,e)){return}if(s.type!==t){i=Um(t,e.queue);if(i===null){return}s=e.queue[i]}e.queue.splice(i,1);e.queuePending[t]=s;s.action(t,e);if(!s.doneFn){e.queuePending[t]=null;Fm(t,e);return}};const Bm=(t,e)=>{const i=e[`${t}Buffer`];const s=Rm(t);if(!i){return}i.removeEventListener("updateend",e[`on${s}UpdateEnd_`]);i.removeEventListener("error",e[`on${s}Error_`]);e.codecs[t]=null;e[`${t}Buffer`]=null};const qm=(t,e)=>t&&e&&Array.prototype.indexOf.call(t.sourceBuffers,e)!==-1;const Vm={appendBuffer:(t,e,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(!qm(n.mediaSource,r)){return}n.logger_(`Appending segment ${e.mediaIndex}'s ${t.length} bytes to ${s}Buffer`);try{r.appendBuffer(t)}catch(t){n.logger_(`Error with code ${t.code} `+(t.code===bm?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`);n.queuePending[s]=null;i(t)}},remove:(t,e)=>(i,s)=>{const n=s[`${i}Buffer`];if(!qm(s.mediaSource,n)){return}s.logger_(`Removing ${t} to ${e} from ${i}Buffer`);try{n.remove(t,e)}catch(n){s.logger_(`Remove ${t} to ${e} from ${i}Buffer failed`)}},timestampOffset:t=>(e,i)=>{const s=i[`${e}Buffer`];if(!qm(i.mediaSource,s)){return}i.logger_(`Setting ${e}timestampOffset to ${t}`);s.timestampOffset=t},callback:t=>(e,i)=>{t()},endOfStream:t=>e=>{if(e.mediaSource.readyState!=="open"){return}e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(t){el.log.warn("Failed to call media source endOfStream",t)}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(t){el.log.warn("Failed to set media source duration",t)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open"){return}const i=e[`${t}Buffer`];if(!qm(e.mediaSource,i)){return}e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){el.log.warn(`Failed to abort on ${t}Buffer`,e)}},addSourceBuffer:(t,e)=>i=>{const s=Rm(t);const n=qt(e);i.logger_(`Adding ${t}Buffer with codec ${e} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]);r.addEventListener("error",i[`on${s}Error_`]);i.codecs[t]=e;i[`${t}Buffer`]=r},removeSourceBuffer:t=>e=>{const i=e[`${t}Buffer`];Bm(t,e);if(!qm(e.mediaSource,i)){return}e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(e){el.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,e)}},changeType:t=>(e,i)=>{const s=i[`${e}Buffer`];const n=qt(t);if(!qm(i.mediaSource,s)){return}if(i.codecs[e]===t){return}i.logger_(`changing ${e}Buffer codec from ${i.codecs[e]} to ${t}`);s.changeType(n);i.codecs[e]=t}};const Hm=({type:t,sourceUpdater:e,action:i,doneFn:s,name:n})=>{e.queue.push({type:t,action:i,doneFn:s,name:n});Fm(t,e)};const zm=(t,e)=>i=>{if(e.queuePending[t]){const i=e.queuePending[t].doneFn;e.queuePending[t]=null;if(i){i(e[`${t}Error_`])}}Fm(t,e)};class Xm extends el.EventTarget{constructor(t){super();this.mediaSource=t;this.sourceopenListener_=()=>Fm("mediaSource",this);this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=ul("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=zm("video",this);this.onAudioUpdateEnd_=zm("audio",this);this.onVideoError_=t=>{this.videoError_=t};this.onAudioError_=t=>{this.audioError_=t};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(t){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(t);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(t,e){Hm({type:"mediaSource",sourceUpdater:this,action:Vm.addSourceBuffer(t,e),name:"addSourceBuffer"})}abort(t){Hm({type:t,sourceUpdater:this,action:Vm.abort(t),name:"abort"})}removeSourceBuffer(t){if(!this.canRemoveSourceBuffer()){el.log.error("removeSourceBuffer is not supported!");return}Hm({type:"mediaSource",sourceUpdater:this,action:Vm.removeSourceBuffer(t),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!el.browser.IS_FIREFOX&&o.MediaSource&&o.MediaSource.prototype&&typeof o.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return o.SourceBuffer&&o.SourceBuffer.prototype&&typeof o.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(t,e){if(!this.canChangeType()){el.log.error("changeType is not supported!");return}Hm({type:t,sourceUpdater:this,action:Vm.changeType(e),name:"changeType"})}addOrChangeSourceBuffers(t){if(!t||typeof t!=="object"||Object.keys(t).length===0){throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs")}Object.keys(t).forEach((e=>{const i=t[e];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(e,i)}if(this.canChangeType()){this.changeType(e,i)}}))}appendBuffer(t,e){const{segmentInfo:i,type:s,bytes:n}=t;this.processedAppend_=true;if(s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([t,e]);this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=e;Hm({type:s,sourceUpdater:this,action:Vm.appendBuffer(n,i||{mediaIndex:-1},r),doneFn:e,name:"appendBuffer"});if(s==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const t=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${t.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;t.forEach((t=>{this.appendBuffer.apply(this,t)}))}}audioBuffered(){if(!qm(this.mediaSource,this.audioBuffer)){return fl()}return this.audioBuffer.buffered?this.audioBuffer.buffered:fl()}videoBuffered(){if(!qm(this.mediaSource,this.videoBuffer)){return fl()}return this.videoBuffer.buffered?this.videoBuffer.buffered:fl()}buffered(){const t=qm(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const e=qm(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(e&&!t){return this.audioBuffered()}if(t&&!e){return this.videoBuffered()}return yl(this.audioBuffered(),this.videoBuffered())}setDuration(t,e=Lm){Hm({type:"mediaSource",sourceUpdater:this,action:Vm.duration(t),name:"duration",doneFn:e})}endOfStream(t=null,e=Lm){if(typeof t!=="string"){t=undefined}Hm({type:"mediaSource",sourceUpdater:this,action:Vm.endOfStream(t),name:"endOfStream",doneFn:e})}removeAudio(t,e,i=Lm){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Hm({type:"audio",sourceUpdater:this,action:Vm.remove(t,e),doneFn:i,name:"remove"})}removeVideo(t,e,i=Lm){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Hm({type:"video",sourceUpdater:this,action:Vm.remove(t,e),doneFn:i,name:"remove"})}updating(){if(Pm("audio",this)||Pm("video",this)){return true}return false}audioTimestampOffset(t){if(typeof t!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==t){Hm({type:"audio",sourceUpdater:this,action:Vm.timestampOffset(t),name:"timestampOffset"});this.audioTimestampOffset_=t}return this.audioTimestampOffset_}videoTimestampOffset(t){if(typeof t!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset!==t){Hm({type:"video",sourceUpdater:this,action:Vm.timestampOffset(t),name:"timestampOffset"});this.videoTimestampOffset_=t}return this.videoTimestampOffset_}audioQueueCallback(t){if(!this.audioBuffer){return}Hm({type:"audio",sourceUpdater:this,action:Vm.callback(t),name:"callback"})}videoQueueCallback(t){if(!this.videoBuffer){return}Hm({type:"video",sourceUpdater:this,action:Vm.callback(t),name:"callback"})}dispose(){this.trigger("dispose");$m.forEach((t=>{this.abort(t);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(t)}else{this[`${t}QueueCallback`]((()=>Bm(t,this)))}}));this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const Gm=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t)));const Wm=new Uint8Array("\n\n".split("").map((t=>t.charCodeAt(0))));class Ym extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Km extends Om{constructor(t,e={}){super(t,e);this.mediaSource_=null;this.subtitlesTrack_=null;this.loaderType_="subtitle";this.featuresNativeTextTracks_=t.featuresNativeTextTracks;this.loadVttJs=t.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return fl()}const t=this.subtitlesTrack_.cues;const e=t[0].startTime;const i=t[t.length-1].startTime;return fl([[e,i]])}initSegmentForMap(t,e=false){if(!t){return null}const i=Dd(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){const e=Wm.byteLength+t.bytes.byteLength;const n=new Uint8Array(e);n.set(t.bytes);n.set(Wm,t.bytes.byteLength);this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:n}}return s||t}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(t){if(typeof t==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=t;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(t,e){dm(t,e,this.subtitlesTrack_)}fillBuffer_(){const t=this.chooseNextRequest_();if(!t){return}if(this.syncController_.timestampOffsetForTimeline(t.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_(t)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(t){while(t&&t.segment.empty){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t}stopForError(t){this.error(t);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(t,e,i){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(e.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(t){if(t.code===kp.TIMEOUT){this.handleTimeout_()}if(t.code===kp.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(t);return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats);if(e.key){this.segmentKey(e.key,true)}this.state="APPENDING";this.trigger("appending");const n=s.segment;if(n.map){n.map.bytes=e.map.bytes}s.bytes=e.bytes;if(typeof o.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then((()=>this.segmentRequestFinished_(t,e,i)),(()=>this.stopForError({message:"Error loading vtt.js"})));return}n.requested=true;try{this.parseVTTCues_(s)}catch(t){this.stopForError({message:t.message});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((t=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new o.VTTCue(t.startTime,t.endTime,t.text):t)}));pm(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let e;let i=false;if(typeof o.WebVTT!=="function"){throw new Ym}if(typeof o.TextDecoder==="function"){e=new o.TextDecoder("utf8")}else{e=o.WebVTT.StringDecoder();i=true}const s=new o.WebVTT.Parser(o,o.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=t=>{el.log.warn("Error encountered when parsing cues: "+t.message)};if(t.segment.map){let e=t.segment.map.bytes;if(i){e=Gm(e)}s.parse(e)}let n=t.bytes;if(i){n=Gm(n)}s.parse(n);s.flush()}updateTimeMapping_(t,e,i){const s=t.segment;if(!e){return}if(!t.cues.length){s.empty=true;return}const n=t.timestampmap;const r=n.MPEGTS/io.ONE_SECOND_IN_TS-n.LOCAL+e.mapping;t.cues.forEach((t=>{t.startTime+=r;t.endTime+=r}));if(!i.syncInfo){const e=t.cues[0].startTime;const n=t.cues[t.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:Math.min(e,n-s.duration)}}}}const Qm=function(t,e){const i=t.cues;for(let t=0;t<i.length;t++){const s=i[t];if(e>=s.adStartTime&&e<=s.adEndTime){return s}}return null};const Jm=function(t,e,i=0){if(!t.segments){return}let s=i;let n;for(let i=0;i<t.segments.length;i++){const r=t.segments[i];if(!n){n=Qm(e,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 o.VTTCue(s,s+r.duration,r.cueOut);n.adStartTime=s;n.adEndTime=s+parseFloat(r.cueOut);e.addCue(n)}if("cueOutCont"in r){const[t,i]=r.cueOutCont.split("/").map(parseFloat);n=new o.VTTCue(s,s+r.duration,"");n.adStartTime=s-t;n.adEndTime=n.adStartTime+i;e.addCue(n)}}s+=r.duration}};const Zm=86400;const tv=[{name:"VOD",run:(t,e,i,s,n)=>{if(i!==Infinity){const t={time:0,segmentIndex:0,partIndex:null};return t}return null}},{name:"ProgramDateTime",run:(t,e,i,s,n)=>{if(!Object.keys(t.timelineToDatetimeMappings).length){return null}let r=null;let o=null;const a=xl(e);n=n||0;for(let i=0;i<a.length;i++){const s=e.endList||n===0?i:a.length-(i+1);const h=a[s];const u=h.segment;const c=t.timelineToDatetimeMappings[u.timeline];if(!c||!u.dateTimeObject){continue}const f=u.dateTimeObject.getTime()/1e3;let l=f+c;if(u.parts&&typeof h.partIndex==="number"){for(let t=0;t<h.partIndex;t++){l+=u.parts[t].duration}}const d=Math.abs(n-l);if(o!==null&&(d===0||o<d)){break}o=d;r={time:l,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}return r}},{name:"Segment",run:(t,e,i,s,n)=>{let r=null;let o=null;n=n||0;const a=xl(e);for(let t=0;t<a.length;t++){const i=e.endList||n===0?t:a.length-(t+1);const h=a[i];const u=h.segment;const c=h.part&&h.part.start||u&&u.start;if(u.timeline===s&&typeof c!=="undefined"){const t=Math.abs(n-c);if(o!==null&&o<t){break}if(!r||o===null||o>=t){o=t;r={time:c,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}}return r}},{name:"Discontinuity",run:(t,e,i,s,n)=>{let r=null;n=n||0;if(e.discontinuityStarts&&e.discontinuityStarts.length){let i=null;for(let s=0;s<e.discontinuityStarts.length;s++){const o=e.discontinuityStarts[s];const a=e.discontinuitySequence+s+1;const h=t.discontinuities[a];if(h){const t=Math.abs(n-h.time);if(i!==null&&i<t){break}if(!r||i===null||i>=t){i=t;r={time:h.time,segmentIndex:o,partIndex:null}}}}}return r}},{name:"Playlist",run:(t,e,i,s,n)=>{if(e.syncInfo){const t={time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null};return t}return null}}];class ev extends el.EventTarget{constructor(t={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};this.logger_=ul("SyncController")}getSyncPoint(t,e,i,s){const n=this.runStrategies_(t,e,i,s);if(!n.length){return null}return this.selectSyncPoint_(n,{key:"time",value:s})}getExpiredTime(t,e){if(!t||!t.segments){return null}const i=this.runStrategies_(t,e,t.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+Ol({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(t,e,i,s){const n=[];for(let r=0;r<tv.length;r++){const o=tv[r];const a=o.run(this,t,e,i,s);if(a){a.strategy=o.name;n.push({strategy:o.name,syncPoint:a})}}return n}selectSyncPoint_(t,e){let i=t[0].syncPoint;let s=Math.abs(t[0].syncPoint[e.key]-e.value);let n=t[0].strategy;for(let r=1;r<t.length;r++){const o=Math.abs(t[r].syncPoint[e.key]-e.value);if(o<s){s=o;i=t[r].syncPoint;n=t[r].strategy}}this.logger_(`syncPoint for [${e.key}: ${e.value}] chosen with strategy`+` [${n}]: [time:${i.time},`+` segmentIndex:${i.segmentIndex}`+(typeof i.partIndex==="number"?`,partIndex:${i.partIndex}`:"")+"]");return i}saveExpiredSegmentInfo(t,e){const i=e.mediaSequence-t.mediaSequence;if(i>Zm){el.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let s=i-1;s>=0;s--){const i=t.segments[s];if(i&&typeof i.start!=="undefined"){e.syncInfo={mediaSequence:t.mediaSequence+s,time:i.start};this.logger_(`playlist refresh sync: [time:${e.syncInfo.time},`+` mediaSequence: ${e.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){this.timelineToDatetimeMappings={};if(t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const e=t.segments[0];const i=e.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[e.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:e}){const i=this.calculateSegmentTimeMapping_(t,t.timingInfo,e);const s=t.segment;if(i){this.saveDiscontinuitySyncInfo_(t);if(!t.playlist.syncInfo){t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:s.start}}}const n=s.dateTimeObject;if(s.discontinuity&&e&&n){this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3)}}timestampOffsetForTimeline(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].time}mappingForTimeline(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].mapping}calculateSegmentTimeMapping_(t,e,i){const s=t.segment;const n=t.part;let r=this.timelines[t.timeline];let o;let a;if(typeof t.timestampOffset==="number"){r={time:t.startOfSegment,mapping:t.startOfSegment-e.start};if(i){this.timelines[t.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${t.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}o=t.startOfSegment;a=e.end+r.mapping}else if(r){o=e.start+r.mapping;a=e.end+r.mapping}else{return false}if(n){n.start=o;n.end=a}if(!s.start||o<s.start){s.start=o}s.end=a;return true}saveDiscontinuitySyncInfo_(t){const e=t.playlist;const i=t.segment;if(i.discontinuity){this.discontinuities[i.timeline]={time:i.start,accuracy:0}}else if(e.discontinuityStarts&&e.discontinuityStarts.length){for(let s=0;s<e.discontinuityStarts.length;s++){const n=e.discontinuityStarts[s];const r=e.discontinuitySequence+s+1;const o=n-t.mediaIndex;const a=Math.abs(o);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>a){let s;if(o<0){s=i.start-Ol({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex,endIndex:n})}else{s=i.end+Ol({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex+1,endIndex:n})}this.discontinuities[r]={time:s,accuracy:a}}}}}dispose(){this.trigger("dispose");this.off()}}class iv extends el.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:e,to:i}){if(typeof e==="number"&&typeof i==="number"){this.pendingTimelineChanges_[t]={type:t,from:e,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:e,to:i}){if(typeof e==="number"&&typeof i==="number"){this.lastTimelineChanges_[t]={type:t,from:e,to:i};delete this.pendingTimelineChanges_[t];this.trigger("timelinechange")}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const sv=op(ap((function(){var t=function(){function t(){this.listeners={}}var e=t.prototype;e.on=function t(e,i){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(i)};e.off=function t(e,i){if(!this.listeners[e]){return false}var s=this.listeners[e].indexOf(i);this.listeners[e]=this.listeners[e].slice(0);this.listeners[e].splice(s,1);return s>-1};e.trigger=function t(e){var i=this.listeners[e];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 o=i.length;for(var a=0;a<o;++a){i[a].apply(this,r)}}};e.dispose=function t(){this.listeners={}};e.pipe=function t(e){this.on("data",(function(t){e.push(t)}))};return t}();
|
|
27
|
+
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(t){return t.subarray(0,t.byteLength-t[t.byteLength-1])}
|
|
28
|
+
/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const i=function(){const t=[[[],[],[],[],[]],[[],[],[],[],[]]];const e=t[0];const i=t[1];const s=e[4];const n=i[4];let r;let o;let a;const h=[];const u=[];let c;let f;let l;let d;let p;let m;for(r=0;r<256;r++){u[(h[r]=r<<1^(r>>7)*283)^r]=r}for(o=a=0;!s[o];o^=c||1,a=u[a]||1){d=a^a<<1^a<<2^a<<3^a<<4;d=d>>8^d&255^99;s[o]=d;n[d]=o;l=h[f=h[c=h[o]]];m=l*16843009^f*65537^c*257^o*16843008;p=h[d]*257^d*16843008;for(r=0;r<4;r++){e[r][o]=p=p<<24^p>>>8;i[r][d]=m=m<<24^m>>>8}}for(r=0;r<5;r++){e[r]=e[r].slice(0);i[r]=i[r].slice(0)}return t};let s=null;class n{constructor(t){if(!s){s=i()}this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let e;let n;let r;const o=this._tables[0][4];const a=this._tables[1];const h=t.length;let u=1;if(h!==4&&h!==6&&h!==8){throw new Error("Invalid aes key size")}const c=t.slice(0);const f=[];this._key=[c,f];for(e=h;e<4*h+28;e++){r=c[e-1];if(e%h===0||h===8&&e%h===4){r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[r&255];if(e%h===0){r=r<<8^r>>>24^u<<24;u=u<<1^(u>>7)*283}}c[e]=c[e-h]^r}for(n=0;e;n++,e--){r=c[n&3?e:e-4];if(e<=4||n<4){f[n]=r}else{f[n]=a[0][o[r>>>24]]^a[1][o[r>>16&255]]^a[2][o[r>>8&255]]^a[3][o[r&255]]}}}decrypt(t,e,i,s,n,r){const o=this._key[1];let a=t^o[0];let h=s^o[1];let u=i^o[2];let c=e^o[3];let f;let l;let d;const p=o.length/4-2;let m;let v=4;const g=this._tables[1];const y=g[0];const b=g[1];const w=g[2];const T=g[3];const S=g[4];for(m=0;m<p;m++){f=y[a>>>24]^b[h>>16&255]^w[u>>8&255]^T[c&255]^o[v];l=y[h>>>24]^b[u>>16&255]^w[c>>8&255]^T[a&255]^o[v+1];d=y[u>>>24]^b[c>>16&255]^w[a>>8&255]^T[h&255]^o[v+2];c=y[c>>>24]^b[a>>16&255]^w[h>>8&255]^T[u&255]^o[v+3];v+=4;a=f;h=l;u=d}for(m=0;m<4;m++){n[(3&-m)+r]=S[a>>>24]<<24^S[h>>16&255]<<16^S[u>>8&255]<<8^S[c&255]^o[v++];f=a;a=h;h=u;u=c;c=f}}}class r extends t{constructor(){super(t);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(t){this.jobs.push(t);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const o=function(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24};const a=function(t,e,i){const s=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2);const r=new n(Array.prototype.slice.call(e));const a=new Uint8Array(t.byteLength);const h=new Int32Array(a.buffer);let u;let c;let f;let l;let d;let p;let m;let v;let g;u=i[0];c=i[1];f=i[2];l=i[3];for(g=0;g<s.length;g+=4){d=o(s[g]);p=o(s[g+1]);m=o(s[g+2]);v=o(s[g+3]);r.decrypt(d,p,m,v,h,g);h[g]=o(h[g]^u);h[g+1]=o(h[g+1]^c);h[g+2]=o(h[g+2]^f);h[g+3]=o(h[g+3]^l);u=d;c=p;f=m;l=v}return a};class h{constructor(t,i,s,n){const a=h.STEP;const u=new Int32Array(t.buffer);const c=new Uint8Array(t.byteLength);let f=0;this.asyncStream_=new r;this.asyncStream_.push(this.decryptChunk_(u.subarray(f,f+a),i,s,c));for(f=a;f<u.length;f+=a){s=new Uint32Array([o(u[f-4]),o(u[f-3]),o(u[f-2]),o(u[f-1])]);this.asyncStream_.push(this.decryptChunk_(u.subarray(f,f+a),i,s,c))}this.asyncStream_.push((function(){n(null,e(c))}))}static get STEP(){return 32e3}decryptChunk_(t,e,i,s){return function(){const n=a(t,e,i);s.set(n,t.byteOffset)}}}var u=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var c;if(typeof window!=="undefined"){c=window}else if(typeof u!=="undefined"){c=u}else if(typeof self!=="undefined"){c=self}else{c={}}var f=c;var l=function t(e){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(e)}return e&&e.buffer instanceof ArrayBuffer};var d=f.BigInt||Number;[d("0x1"),d("0x100"),d("0x10000"),d("0x1000000"),d("0x100000000"),d("0x10000000000"),d("0x1000000000000"),d("0x100000000000000"),d("0x10000000000000000")];const p=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(l(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};self.onmessage=function(t){const e=t.data;const i=new Uint8Array(e.encrypted.bytes,e.encrypted.byteOffset,e.encrypted.byteLength);const s=new Uint32Array(e.key.bytes,e.key.byteOffset,e.key.byteLength/4);const n=new Uint32Array(e.iv.bytes,e.iv.byteOffset,e.iv.byteLength/4);new h(i,s,n,(function(t,i){self.postMessage(p({source:e.source,decrypted:i}),[i.buffer])}))}})));var nv=rp(sv);const rv=t=>{let e=t.default?"main":"alternative";if(t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0){e="main-desc"}return e};const ov=(t,e)=>{t.abort();t.pause();if(e&&e.activePlaylistLoader){e.activePlaylistLoader.pause();e.activePlaylistLoader=null}};const av=(t,e)=>{e.activePlaylistLoader=t;t.load()};const hv=(t,e)=>()=>{const{segmentLoaders:{[t]:i,main:s},mediaTypes:{[t]:n}}=e;const r=n.activeTrack();const o=n.getActiveGroup();const a=n.activePlaylistLoader;const h=n.lastGroup_;if(o&&h&&o.id===h.id){return}n.lastGroup_=o;n.lastTrack_=r;ov(i,n);if(!o||o.isMainPlaylist){return}if(!o.playlistLoader){if(a){s.resetEverything()}return}i.resyncLoader();av(o.playlistLoader,n)};const uv=(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s}}=e;s.lastGroup_=null;i.abort();i.pause()};const cv=(t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:s,main:n},mediaTypes:{[t]:r}}=e;const o=r.activeTrack();const a=r.getActiveGroup();const h=r.activePlaylistLoader;const u=r.lastTrack_;if(u&&o&&u.id===o.id){return}r.lastGroup_=a;r.lastTrack_=o;ov(s,r);if(!a){return}if(a.isMainPlaylist){if(!o||!u||o.id===u.id){return}const t=e.vhs.playlistController_;const s=t.selectPlaylist();if(t.media()===s){return}r.logger_(`track change. Switching main audio from ${u.id} to ${o.id}`);i.pause();n.resetEverything();t.fastQualityChange_(s);return}if(t==="AUDIO"){if(!a.playlistLoader){n.setAudio(true);n.resetEverything();return}s.setAudio(true);n.setAudio(false)}if(h===a.playlistLoader){av(a.playlistLoader,r);return}if(s.track){s.track(o)}s.resetEverything();av(a.playlistLoader,r)};const fv={AUDIO:(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s},excludePlaylist:n}=e;ov(i,s);const r=s.activeTrack();const o=s.activeGroup();const a=(o.filter((t=>t.default))[0]||o[0]).id;const h=s.tracks[a];if(r===h){n({error:{message:"Problem encountered loading the default audio track."}});return}el.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const t in s.tracks){s.tracks[t].enabled=s.tracks[t]===h}s.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s}}=e;el.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");ov(i,s);const n=s.activeTrack();if(n){n.mode="disabled"}s.onTrackChanged()}};const lv={AUDIO:(t,e,i)=>{if(!e){return}const{tech:s,requestOptions:n,segmentLoaders:{[t]:r}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",fv[t](t,i))},SUBTITLES:(t,e,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[t]:r},mediaTypes:{[t]:o}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);r.track(o.activeTrack());if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",fv[t](t,i))}};const dv={AUDIO:(t,e)=>{const{vhs:i,sourceType:s,segmentLoaders:{[t]:n},requestOptions:r,main:{mediaGroups:o},mediaTypes:{[t]:{groups:a,tracks:h,logger_:u}},mainPlaylistLoader:c}=e;const f=Wl(c.main);if(!o[t]||Object.keys(o[t]).length===0){o[t]={main:{default:{default:true}}};if(f){o[t].main.default.playlists=c.main.playlists}}for(const n in o[t]){if(!a[n]){a[n]=[]}for(const l in o[t][n]){let d=o[t][n][l];let p;if(f){u(`AUDIO group '${n}' label '${l}' is a main playlist`);d.isMainPlaylist=true;p=null}else if(s==="vhs-json"&&d.playlists){p=new vd(d.playlists[0],i,r)}else if(d.resolvedUri){p=new vd(d.resolvedUri,i,r)}else if(d.playlists&&s==="dash"){p=new tp(d.playlists[0],i,r,c)}else{p=null}d=cl({id:l,playlistLoader:p},d);lv[t](t,d.playlistLoader,e);a[n].push(d);if(typeof h[l]==="undefined"){const t=new el.AudioTrack({id:l,kind:rv(d),enabled:false,language:d.language,default:d.default,label:l});h[l]=t}}}n.on("error",fv[t](t,e))},SUBTITLES:(t,e)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[t]:r},requestOptions:o,main:{mediaGroups:a},mediaTypes:{[t]:{groups:h,tracks:u}},mainPlaylistLoader:c}=e;for(const r in a[t]){if(!h[r]){h[r]=[]}for(const f in a[t][r]){if(!s.options_.useForcedSubtitles&&a[t][r][f].forced){continue}let l=a[t][r][f];let d;if(n==="hls"){d=new vd(l.resolvedUri,s,o)}else if(n==="dash"){const t=l.playlists.filter((t=>t.excludeUntil!==Infinity));if(!t.length){return}d=new tp(l.playlists[0],s,o,c)}else if(n==="vhs-json"){d=new vd(l.playlists?l.playlists[0]:l.resolvedUri,s,o)}l=cl({id:f,playlistLoader:d},l);lv[t](t,l.playlistLoader,e);h[r].push(l);if(typeof u[f]==="undefined"){const t=i.addRemoteTextTrack({id:f,kind:"subtitles",default:l.default&&l.autoselect,language:l.language,label:f},false).track;u[f]=t}}}r.on("error",fv[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[t]:{groups:n,tracks:r}}}=e;for(const e in s[t]){if(!n[e]){n[e]=[]}for(const o in s[t][e]){const a=s[t][e][o];if(!/^(?:CC|SERVICE)/.test(a.instreamId)){continue}const h=i.options_.vhs&&i.options_.vhs.captionServices||{};let u={label:o,language:a.language,instreamId:a.instreamId,default:a.default&&a.autoselect};if(h[u.instreamId]){u=cl(u,h[u.instreamId])}if(u.default===undefined){delete u.default}n[e].push(cl({id:o},a));if(typeof r[o]==="undefined"){const t=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},false).track;r[o]=t}}}}};const pv=(t,e)=>{for(let i=0;i<t.length;i++){if(Xl(e,t[i])){return true}if(t[i].playlists&&pv(t[i].playlists,e)){return true}}return false};const mv=(t,e)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[t]:{groups:n}}}=e;const r=s.media();if(!r){return null}let o=null;if(r.attributes[t]){o=n[r.attributes[t]]}const a=Object.keys(n);if(!o){if(t==="AUDIO"&&a.length>1&&Wl(e.main)){for(let t=0;t<a.length;t++){const e=n[a[t]];if(pv(e,r)){o=e;break}}}else if(n.main){o=n.main}else if(a.length===1){o=n[a[0]]}}if(typeof i==="undefined"){return o}if(i===null||!o){return null}return o.filter((t=>t.id===i.id))[0]||null};const vv={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].enabled){return i[t]}}return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].mode==="showing"||i[t].mode==="hidden"){return i[t]}}return null}};const gv=(t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();if(!i){return null}return e[t].activeGroup(i)};const yv=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{dv[e](e,t)}));const{mediaTypes:e,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:o}}=t;["AUDIO","SUBTITLES"].forEach((i=>{e[i].activeGroup=mv(i,t);e[i].activeTrack=vv[i](i,t);e[i].onGroupChanged=hv(i,t);e[i].onGroupChanging=uv(i,t);e[i].onTrackChanged=cv(i,t);e[i].getActiveGroup=gv(i,t)}));const a=e.AUDIO.activeGroup();if(a){const t=(a.filter((t=>t.default))[0]||a[0]).id;e.AUDIO.tracks[t].enabled=true;e.AUDIO.onGroupChanged();e.AUDIO.onTrackChanged();const i=e.AUDIO.getActiveGroup();if(!i.playlistLoader){o.setAudio(true)}else{o.setAudio(false);r.setAudio(true)}}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanged()))}));i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanging()))}));const h=()=>{e.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",h);s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged);n.on("dispose",(()=>{s.audioTracks().removeEventListener("change",h);s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}));s.clearTracks("audio");for(const t in e.AUDIO.tracks){s.audioTracks().addTrack(e.AUDIO.tracks[t])}};const bv=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Lm,activeTrack:Lm,getActiveGroup:Lm,onGroupChanged:Lm,onTrackChanged:Lm,lastTrack_:null,logger_:ul(`MediaGroups[${e}]`)}}));return t};const wv=10;let Tv;const Sv=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const kv=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]};const Ev=function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:o,bufferBasedABR:a,log:h}){if(!s){el.log.warn("We received no playlist to switch to. Please check your stream.");return false}const u=`allowing switch ${t&&t.id||"null"} -> ${s.id}`;if(!t){h(`${u} as current playlist is not set`);return true}if(s.id===t.id){return false}const c=Boolean(ml(e,i).length);if(!t.endList){if(!c&&typeof t.partTargetDuration==="number"){h(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}h(`${u} as current playlist is live`);return true}const f=El(e,i);const l=a?ep.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ep.MAX_BUFFER_LOW_WATER_LINE;if(o<l){h(`${u} as duration < max low water line (${o} < ${l})`);return true}const d=s.attributes.BANDWIDTH;const p=t.attributes.BANDWIDTH;if(d<p&&(!a||f<r)){let t=`${u} as next bandwidth < current bandwidth (${d} < ${p})`;if(a){t+=` and forwardBuffer < bufferHighWaterLine (${f} < ${r})`}h(t);return true}if((!a||d>p)&&f>=n){let t=`${u} as forwardBuffer >= bufferLowWaterLine (${f} >= ${n})`;if(a){t+=` and next bandwidth > current bandwidth (${d} > ${p})`}h(t);return true}h(`not ${u} as no switching criteria met`);return false};class Iv extends el.EventTarget{constructor(t){super();const{src:e,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:a,playlistExclusionDuration:h,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:f,bufferBasedABR:l,leastPixelDiffSelector:d,captionServices:p}=t;if(!e){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:m}=t;if(m===null||typeof m==="undefined"){m=Infinity}Tv=r;this.bufferBasedABR=Boolean(l);this.leastPixelDiffSelector=Boolean(d);this.withCredentials=i;this.tech_=s;this.vhs_=s.vhs;this.sourceType_=c;this.useCueTags_=a;this.playlistExclusionDuration=h;this.maxPlaylistRetries=m;this.enableLowInitialPlaylist=u;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=bv();this.mediaSource=new o.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_=fl();this.hasPlayed_=false;this.syncController_=new ev(t);this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new nv;this.sourceUpdater_=new Xm(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new iv;const v={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:p,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:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new tp(e,this.vhs_,cl(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new vd(e,this.vhs_,cl(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new Om(cl(v,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t);this.audioSegmentLoader_=new Om(cl(v,{loaderType:"audio"}),t);this.subtitleSegmentLoader_=new Km(cl(v,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((t,e)=>{function i(){s.off("vttjserror",n);t()}function n(){s.off("vttjsloaded",i);e()}s.one("vttjsloaded",i);s.one("vttjserror",n);s.addWebVttScript_()}))}),t);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_()));this.tech_.on("pause",(()=>this.stopABRTimer_()));this.tech_.on("play",(()=>this.startABRTimer_()))}Sv.forEach((t=>{this[t+"_"]=kv.bind(this,t)}));this.logger_=ul("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 g=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(g,(()=>{const t=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-t;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_();const e=this.audioAppendsToLoadedData_();if(t===-1||e===-1){return-1}return t+e}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const e=this.selectPlaylist();if(e&&this.shouldSwitchToMedia_(e)){this.switchMedia_(e,t)}}switchMedia_(t,e,i){const s=this.media();const n=s&&(s.id||s.uri);const r=t.id||t.uri;if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${e}`);this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${e}`})}this.mainPlaylistLoader_.media(t,i)}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=o.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}o.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 t=i.main||s.length&&i[s[0]];for(const e in t){if(t[e].default){n={label:e};break}}}if(!n){return e}const r=[];for(const e in i){if(i[e][n.label]){const s=i[e][n.label];if(s.playlists&&s.playlists.length){r.push.apply(r,s.playlists)}else if(s.uri){r.push(s)}else if(t.playlists.length){for(let i=0;i<t.playlists.length;i++){const s=t.playlists[i];if(s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===e){r.push(s)}}}}}if(!r.length){return e}return r}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(zl(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(t.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(t,this.requestOptions_);this.mainSegmentLoader_.load()}yv({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(),t);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.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 t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()}));this.mainPlaylistLoader_.on("mediachange",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(zl(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}this.mainPlaylistLoader_.load();this.mainSegmentLoader_.playlist(t,this.requestOptions_);this.mainSegmentLoader_.load();this.tech_.trigger({type:"mediachange",bubbles:true})}));this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged"){return}const e=this.stuckAtPlaylistEnd_(t);if(e){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"})}))}handleUpdatedMediaPlaylist(t){if(this.useCueTags_){this.updateAdCues_(t)}this.mainSegmentLoader_.playlist(t,this.requestOptions_);this.updateDuration(!t.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(t,e){const i=t.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const t in i.AUDIO){for(const e in i.AUDIO[t]){const n=i.AUDIO[t][e];if(!n.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(Tv.Playlist.isAes(e)){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_(t){const e=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 Ev({buffered:r,currentTime:i,currentPlaylist:e,nextPlaylist:t,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 t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));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()}));this.mainSegmentLoader_.on("earlyabort",(t=>{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:wv})}));const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t);this.audioSegmentLoader_.on("trackinfo",t);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()}))}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_(t=this.selectPlaylist()){if(t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality");this.resetMainLoaderReplaceSegments()}resetMainLoaderReplaceSegments(){const t=this.tech_.buffered();const e=t.end(t.length-1);this.mainSegmentLoader_.replaceSegmentsUntil=e;this.mainSegmentLoader_.resetLoaderProperties();this.mainSegmentLoader_.resetLoader()}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const t=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<t.start(0)){return this.tech_.setCurrentTime(t.end(t.length-1))}}}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_){return false}if(!t.endList||t.start){const e=this.seekable();if(!e.length){return false}const i=e.end(0);let s=i;if(t.start){const n=t.start.timeOffset;if(n<0){s=Math.max(i+n,e.start(0))}else{s=Math.min(i,n)}}this.trigger("firstplay");this.tech_.setCurrentTime(s)}this.hasPlayed_=true;this.load();return true}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const t=this.tech_.play();if(typeof t!=="undefined"&&typeof t.then==="function"){t.then(null,(t=>{}))}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length){return}const e=this.duration();t[t.length-1].endTime=isNaN(e)||Math.abs(e)===Infinity?Number.MAX_VALUE:e}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const e=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!e||e.hasVideo){t=t&&this.audioSegmentLoader_.ended_}else{t=this.audioSegmentLoader_.ended_}}if(!t){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(t){const e=this.seekable();if(!e.length){return false}const i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return false}const s=Tv.Playlist.playlistEnd(t,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=dl}const o=r.end(r.length-1);return o-n<=dl&&s-o<=dl}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:i}){t=t||this.mainPlaylistLoader_.media();i=i||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!t){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}t.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists;const n=s.filter(Fl);const r=n.length===1&&n[0]===t;if(s.length===1&&i!==Infinity){el.log.warn(`Problem encountered with playlist ${t.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){let e=false;s.forEach((i=>{if(i===t){return}const s=i.excludeUntil;if(typeof s!=="undefined"&&s!==Infinity){e=true;delete i.excludeUntil}}));if(e){el.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let o;if(t.playlistErrors_>this.maxPlaylistRetries){o=Infinity}else{o=Date.now()+i*1e3}t.excludeUntil=o;if(e.reason){t.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const a=this.selectPlaylist();if(!a){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const h=e.internal?this.logger_:el.log.warn;const u=e.message?" "+e.message:"";h(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.`+`${u} Switching to playlist ${a.id}.`);if(a.attributes.AUDIO!==t.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(a.attributes.SUBTITLES!==t.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const c=a.targetDuration/2*1e3||5*1e3;const f=typeof a.lastRequest==="number"&&Date.now()-a.lastRequest<=c;return this.switchMedia_(a,"exclude",r||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(t,e){const i=[];const s=t==="all";if(s||t==="main"){i.push(this.mainPlaylistLoader_)}const n=[];if(s||t==="audio"){n.push("AUDIO")}if(s||t==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach((t=>{const e=this.mediaTypes_[t]&&this.mediaTypes_[t].activePlaylistLoader;if(e){i.push(e)}}));["main","audio","subtitle"].forEach((e=>{const s=this[`${e}SegmentLoader_`];if(s&&(t===e||t==="all")){i.push(s)}}));i.forEach((t=>e.forEach((e=>{if(typeof t[e]==="function"){t[e]()}}))))}setCurrentTime(t){const e=ml(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(e&&e.length){return t}this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const t=this.mainPlaylistLoader_.media();if(!t){return 0}if(!t.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return Tv.Playlist.duration(t)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let t;if(!this.mainPlaylistLoader_){return}let e=this.mainPlaylistLoader_.media();if(!e){return}let i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=Tv.Playlist.seekable(e,i,Tv.Playlist.liveEdgeDelay(s,e));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){e=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}t=Tv.Playlist.seekable(e,i,Tv.Playlist.liveEdgeDelay(s,e));if(t.length===0){return}}let r;let o;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);o=this.seekable_.start(0)}if(!t){this.seekable_=n}else if(t.start(0)>n.end(0)||n.start(0)>t.end(0)){this.seekable_=n}else{this.seekable_=fl([[t.start(0)>n.start(0)?t.start(0):n.start(0),t.end(0)<n.end(0)?t.end(0):n.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===r&&this.seekable_.start(0)===o){return}}this.logger_(`seekable updated [${bl(this.seekable_)}]`);this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.updateDuration_=null}if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t);this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const t=this.seekable();if(!t.length){return}if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1)){this.sourceUpdater_.setDuration(t.end(t.length-1))}return}const e=this.tech_.buffered();let i=Tv.Playlist.duration(this.mainPlaylistLoader_.media());if(e.length>0){i=Math.max(i,e.end(e.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach((t=>{const e=this.mediaTypes_[t].groups;for(const t in e){e[t].forEach((t=>{if(t.playlistLoader){t.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 t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const e=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!t?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!e||!i){return false}return true}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const e=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const i=Xp(this.main(),e);const s={};const n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo){s.video=i.video||t.main.videoCodec||Xt}if(t.main.isMuxed){s.video+=`,${i.audio||t.main.audioCodec||zt}`}if(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n){s.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||zt;t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4}if(!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:e,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(t,e)=>t?Vt(e):Ht(e);const o={};let a;["video","audio"].forEach((function(e){if(s.hasOwnProperty(e)&&!r(t[e].isFmp4,s[e])){const i=t[e].isFmp4?"browser":"muxer";o[i]=o[i]||[];o[i].push(s[e]);if(e==="audio"){a=i}}}));if(n&&a&&e.attributes.AUDIO){const t=e.attributes.AUDIO;this.main().playlists.forEach((i=>{const s=i.attributes&&i.attributes.AUDIO;if(s===t&&i!==e){i.excludeUntil=Infinity}}));this.logger_(`excluding audio group ${t} as ${a} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){const t=Object.keys(o).reduce(((t,e)=>{if(t){t+=", "}t+=`${e} does not support codec(s): "${o[e].join(",")}"`;return t}),"")+".";this.excludePlaylist({playlistToExclude:e,error:{internal:true,message:t},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const t=[];["video","audio"].forEach((e=>{const i=(Pt(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const n=(Pt(s[e]||"")[0]||{}).type;if(i&&n&&i.toLowerCase()!==n.toLowerCase()){t.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`)}}));if(t.length){this.excludePlaylist({playlistToExclude:e,error:{message:`Codec switching not supported: ${t.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.createSourceBuffers(t);const e=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(e)}excludeUnsupportedVariants_(){const t=this.main().playlists;const e=[];Object.keys(t).forEach((i=>{const s=t[i];if(e.indexOf(s.id)!==-1){return}e.push(s.id);const n=Xp(this.main,s);const r=[];if(n.audio&&!Ht(n.audio)&&!Vt(n.audio)){r.push(`audio codec ${n.audio}`)}if(n.video&&!Ht(n.video)&&!Vt(n.video)){r.push(`video codec ${n.video}`)}if(n.text&&n.text==="stpp.ttml.im1t"){r.push(`text codec ${n.text}`)}if(r.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`)}}))}excludeIncompatibleVariants_(t){const e=[];const i=this.main().playlists;const s=Hp(Pt(t));const n=zp(s);const r=s.video&&Pt(s.video)[0]||null;const o=s.audio&&Pt(s.audio)[0]||null;Object.keys(i).forEach((t=>{const s=i[t];if(e.indexOf(s.id)!==-1||s.excludeUntil===Infinity){return}e.push(s.id);const a=[];const h=Xp(this.mainPlaylistLoader_.main,s);const u=zp(h);if(!h.audio&&!h.video){return}if(u!==n){a.push(`codec count "${u}" !== "${n}"`)}if(!this.sourceUpdater_.canChangeType()){const t=h.video&&Pt(h.video)[0]||null;const e=h.audio&&Pt(h.audio)[0]||null;if(t&&r&&t.type.toLowerCase()!==r.type.toLowerCase()){a.push(`video codec "${t.type}" !== "${r.type}"`)}if(e&&o&&e.type.toLowerCase()!==o.type.toLowerCase()){a.push(`audio codec "${e.type}" !== "${o.type}"`)}}if(a.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id}: ${a.join(" && ")}`)}}))}updateAdCues_(t){let e=0;const i=this.seekable();if(i.length){e=i.start(0)}Jm(t,this.cueTagsTrack_,e)}goalBufferLength(){const t=this.tech_.currentTime();const e=ep.GOAL_BUFFER_LENGTH;const i=ep.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(e,ep.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,s)}bufferLowWaterLine(){const t=this.tech_.currentTime();const e=ep.BUFFER_LOW_WATER_LINE;const i=ep.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(e,ep.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(e,ep.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return ep.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){lm(this.inbandTextTracks_,"com.apple.streaming",this.tech_);fm({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,e,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();lm(this.inbandTextTracks_,t,this.tech_);hm({inbandTextTracks:this.inbandTextTracks_,metadataArray:e,timestampOffset:s,videoDuration:i})}}const xv=(t,e,i)=>s=>{const n=t.main.playlists[e];const r=Ul(n);const o=Fl(n);if(typeof s==="undefined"){return o}if(s){delete n.disabled}else{n.disabled=true}if(s!==o&&!r){i();if(s){t.trigger("renditionenabled")}else{t.trigger("renditiondisabled")}}return s};class Av{constructor(t,e,i){const{playlistController_:s}=t;const n=s.fastQualityChange_.bind(s);if(e.attributes){const t=e.attributes.RESOLUTION;this.width=t&&t.width;this.height=t&&t.height;this.bandwidth=e.attributes.BANDWIDTH;this.frameRate=e.attributes["FRAME-RATE"]}this.codecs=Xp(s.main(),e);this.playlist=e;this.id=i;this.enabled=xv(t.playlists,e.id,n)}}const Dv=function(t){t.representations=()=>{const e=t.playlistController_.main();const i=Wl(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!i){return[]}return i.filter((t=>!Ul(t))).map(((e,i)=>new Av(t,e,e.id)))}};const Cv=["seeking","seeked","pause","playing","error"];class jv{constructor(t){this.playlistController_=t.playlistController;this.tech_=t.tech;this.seekable=t.seekable;this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta;this.media=t.media;this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=ul("PlaybackWatcher");this.logger_("initialize");const e=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const s=()=>this.techWaiting_();const n=()=>this.resetTimeUpdate_();const r=this.playlistController_;const a=["main","subtitle","audio"];const h={};a.forEach((t=>{h[t]={reset:()=>this.resetSegmentDownloads_(t),updateend:()=>this.checkSegmentDownloads_(t)};r[`${t}SegmentLoader_`].on("appendsdone",h[t].updateend);r[`${t}SegmentLoader_`].on("playlistupdate",h[t].reset);this.tech_.on(["seeked","seeking"],h[t].reset)}));const u=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();u("off")}};this.clearSeekingAppendCheck_=()=>u("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();u("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",s);this.tech_.on(Cv,n);this.tech_.on("canplay",i);this.tech_.one("play",e);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",s);this.tech_.off(Cv,n);this.tech_.off("canplay",i);this.tech_.off("play",e);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);a.forEach((t=>{r[`${t}SegmentLoader_`].off("appendsdone",h[t].updateend);r[`${t}SegmentLoader_`].off("playlistupdate",h[t].reset);this.tech_.off(["seeked","seeking"],h[t].reset)}));if(this.checkCurrentTimeTimeout_){o.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){o.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=o.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const e=this.playlistController_[`${t}SegmentLoader_`];if(this[`${t}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${t} loader`)}this[`${t}StalledDownloads_`]=0;this[`${t}Buffered_`]=e.buffered_()}checkSegmentDownloads_(t){const e=this.playlistController_;const i=e[`${t}SegmentLoader_`];const s=i.buffered_();const n=Sl(this[`${t}Buffered_`],s);this[`${t}Buffered_`]=s;if(n){this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++;this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Tl(s)});if(this[`${t}StalledDownloads_`]<10){return}this.logger_(`${t} loader stalled download exclusion`);this.resetSegmentDownloads_(t);this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`});if(t==="subtitle"){return}e.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+dl>=e.end(e.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(t===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const t=this.tech_.seeking();if(!t){return false}const e=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const t=e.end(e.length-1);n=t}if(this.beforeSeekableWindow_(e,i)){const t=e.start(0);n=t+(t===e.end(0)?0:dl)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${bl(e)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const o=this.tech_.buffered();const a=r.audioBuffer?r.audioBuffered():null;const h=r.videoBuffer?r.videoBuffered():null;const u=this.media();const c=u.partTargetDuration?u.partTargetDuration:(u.targetDuration-ll)*2;const f=[a,h];for(let t=0;t<f.length;t++){if(!f[t]){continue}const e=El(f[t],i);if(e<c){return false}}const l=vl(o,i);if(l.length===0){return false}n=l.start(0)+dl;this.logger_(`Buffered region starts (${l.start(0)}) `+` just beyond seek point (${i}). Seeking to ${n}.`);this.tech_.setCurrentTime(n);return true}waiting_(){if(this.techWaiting_()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();const i=ml(e,t);if(i.length&&t+3<=i.end(0)){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.logger_(`Stopped at ${t} 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 t=this.seekable();const e=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(t,e)){const i=t.end(t.length-1);this.logger_(`Fell out of live window at time ${e}. Seeking to `+`live point (seekable end) ${i}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(i);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:e});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(e);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=vl(s,e);if(r.length>0){this.logger_(`Stopped at ${e} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(e);return true}return false}afterSeekableWindow_(t,e,i,s=false){if(!t.length){return false}let n=t.end(t.length-1)+dl;const r=!i.endList;const o=typeof i.partTargetDuration==="number";if(r&&(o||s)){n=t.end(t.length-1)+i.targetDuration*3}if(e>n){return true}return false}beforeSeekableWindow_(t,e){if(t.length&&t.start(0)>0&&e<t.start(0)-this.liveRangeSafeTimeDelta){return true}return false}videoUnderflow_({videoBuffered:t,audioBuffered:e,currentTime:i}){if(!t){return}let s;if(t.length&&e.length){const n=ml(t,i-3);const r=ml(t,i);const o=ml(e,i);if(o.length&&!r.length&&n.length){s={start:n.end(0),end:o.end(0)}}}else{const e=vl(t,i);if(!e.length){s=this.gapFromVideoUnderflow_(t,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_(t){const e=this.tech_.buffered();const i=this.tech_.currentTime();const s=vl(e,i);this.resetTimeUpdate_();if(s.length===0||i!==t){return}this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",s.start(0));this.tech_.setCurrentTime(s.start(0)+ll);this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,e){const i=gl(t);for(let t=0;t<i.length;t++){const s=i.start(t);const n=i.end(t);if(e-s<4&&e-s>2){return{start:s,end:n}}}return null}}const _v={errorInterval:30,getSource(t){const e=this.tech({IWillNotUseThisInPlugins:true});const i=e.currentSource_||this.currentSource();return t(i)}};const Nv=function(t,e){let i=0;let s=0;const n=cl(_v,e);t.ready((()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){if(s){t.currentTime(s)}};const o=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 a=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"){el.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}i=Date.now();return n.getSource.call(t,o)};const h=function(){t.off("loadedmetadata",r);t.off("error",a);t.off("dispose",h)};const u=function(e){h();Nv(t,e)};t.on("error",a);t.on("dispose",h);t.reloadSourceOnError=u};const Mv=function(t){Nv(this,t)};var Ov="3.5.3";var Lv="7.0.0";var Rv="1.1.1";var $v="7.1.0";var Pv="4.0.1";const Uv={PlaylistLoader:vd,Playlist:Yl,utils:Md,STANDARD_PLAYLIST_SELECTOR:tm,INITIAL_PLAYLIST_SELECTOR:sm,lastBandwidthSelector:tm,movingAverageBandwidthSelector:em,comparePlaylistBandwidth:Qp,comparePlaylistResolution:Jp,xhr:Td()};Object.keys(ep).forEach((t=>{Object.defineProperty(Uv,t,{get(){el.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return ep[t]},set(e){el.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){el.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}ep[t]=e}})}));const Fv="videojs-vhs";const Bv=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 qv=function(t,e){e.representations().forEach((e=>{t.addQualityLevel(e)}));Bv(t,e.playlists)};Uv.canPlaySource=function(){return el.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const Vv=(t,e,i)=>{if(!t){return t}let s={};if(e&&e.attributes&&e.attributes.CODECS){s=Hp(Pt(e.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=qt(s.video);const r=qt(s.audio);const o={};for(const i in t){o[i]={};if(r){o[i].audioContentType=r}if(n){o[i].videoContentType=n}if(e.contentProtection&&e.contentProtection[i]&&e.contentProtection[i].pssh){o[i].pssh=e.contentProtection[i].pssh}if(typeof t[i]==="string"){o[i].url=t[i]}}return cl(t,o)};const Hv=(t,e)=>t.reduce(((t,i)=>{if(!i.contentProtection){return t}const s=e.reduce(((t,e)=>{const s=i.contentProtection[e];if(s&&s.pssh){t[e]={pssh:s.pssh}}return t}),{});if(Object.keys(s).length){t.push(s)}return t}),[]);const zv=({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:s})=>{if(!t.eme.initializeMediaKeys){return Promise.resolve()}const n=i?s.concat([i]):s;const r=Hv(n,Object.keys(e));const o=[];const a=[];r.forEach((e=>{a.push(new Promise(((e,i)=>{t.tech_.one("keysessioncreated",e)})));o.push(new Promise(((i,s)=>{t.eme.initializeMediaKeys({keySystems:e},(t=>{if(t){s(t);return}i()}))})))}));return Promise.race([Promise.all(o),Promise.race(a)])};const Xv=({player:t,sourceKeySystems:e,media:i,audioMedia:s})=>{const n=Vv(e,i,s);if(!n){return false}t.currentSource().keySystems=n;if(n&&!t.eme){el.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const Gv=()=>{if(!o.localStorage){return null}const t=o.localStorage.getItem(Fv);if(!t){return null}try{return JSON.parse(t)}catch(t){return null}};const Wv=t=>{if(!o.localStorage){return false}let e=Gv();e=e?cl(e,t):t;try{o.localStorage.setItem(Fv,JSON.stringify(e))}catch(t){return false}return e};const Yv=t=>{if(t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(t.substring(t.indexOf(",")+1))}return t};const Kv=(t,e)=>{if(!t._requestCallbackSet){t._requestCallbackSet=new Set}t._requestCallbackSet.add(e)};const Qv=(t,e)=>{if(!t._responseCallbackSet){t._responseCallbackSet=new Set}t._responseCallbackSet.add(e)};const Jv=(t,e)=>{if(!t._requestCallbackSet){return}t._requestCallbackSet.delete(e);if(!t._requestCallbackSet.size){delete t._requestCallbackSet}};const Zv=(t,e)=>{if(!t._responseCallbackSet){return}t._responseCallbackSet.delete(e);if(!t._responseCallbackSet.size){delete t._responseCallbackSet}};Uv.supportsNativeHls=function(){if(!l||!l.createElement){return false}const t=l.createElement("video");if(!el.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))}))}();Uv.supportsNativeDash=function(){if(!l||!l.createElement||!el.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(l.createElement("video").canPlayType("application/dash+xml"))}();Uv.supportsTypeNatively=t=>{if(t==="hls"){return Uv.supportsNativeHls}if(t==="dash"){return Uv.supportsNativeDash}return false};Uv.isSupported=function(){return el.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};Uv.xhr.onRequest=function(t){Kv(Uv.xhr,t)};Uv.xhr.onResponse=function(t){Qv(Uv.xhr,t)};Uv.xhr.offRequest=function(t){Jv(Uv.xhr,t)};Uv.xhr.offResponse=function(t){Zv(Uv.xhr,t)};const tg=el.getComponent("Component");class eg extends tg{constructor(t,e,i){super(e,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=ul("VhsHandler");if(e.options_&&e.options_.playerId){const t=el.getPlayer(e.options_.playerId);this.player_=t}this.tech_=e;this.source_=t;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks){e.overrideNativeAudioTracks(true);e.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(l,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(t=>{const e=l.fullscreenElement||l.webkitFullscreenElement||l.mozFullScreenElement||l.msFullscreenElement;if(e&&e.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_(){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 t=Gv();if(t&&t.bandwidth){this.options_.bandwidth=t.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(t&&t.throughput){this.options_.throughput=t.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=ep.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ep.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((t=>{if(typeof this.source_[t]!=="undefined"){this.options_[t]=this.source_[t]}}));this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(t,e){if(!t){return}this.setOptions_();this.options_.src=Yv(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=Uv;this.options_.sourceType=Yt(e);this.options_.seekTo=t=>{this.tech_.setCurrentTime(t)};this.playlistController_=new Iv(this.options_);const i=cl({liveRangeSafeTimeDelta:dl},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new jv(i);this.playlistController_.on("error",(()=>{const t=el.players[this.tech_.options_.playerId];let e=this.playlistController_.error;if(typeof e==="object"&&!e.code){e.code=3}else if(typeof e==="string"){e={message:e,code:3}}t.error(e)}));const s=this.options_.bufferBasedABR?Uv.movingAverageBandwidthSelector(.55):Uv.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this);this.playlistController_.selectInitialPlaylist=Uv.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(t){this.playlistController_.selectPlaylist=t.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(t){this.playlistController_.mainSegmentLoader_.throughput.rate=t;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let t=this.playlistController_.mainSegmentLoader_.bandwidth;const e=o.navigator.connection||o.navigator.mozConnection||o.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&e){const s=e.downlink*1e3*1e3;if(s>=i&&t>=i){t=Math.max(t,s)}else{t=s}}return t},set(t){this.playlistController_.mainSegmentLoader_.bandwidth=t;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const t=1/(this.bandwidth||1);let e;if(this.throughput>0){e=1/this.throughput}else{e=0}const i=Math.floor(1/(t+e));return i},set(){el.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:()=>Tl(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:()=>Tl(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){Wv({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}}));this.playlistController_.on("selectedinitialmedia",(()=>{Dv(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_=o.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");zv({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()})).catch((t=>{this.logger_("error while creating EME key session",t);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 t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const e=Xv({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(t=>{if(t.status!=="output-restricted"){return}const e=this.playlistController_.main();if(!e||!e.playlists){return}const i=[];e.playlists.forEach((t=>{if(t&&t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height>=720){if(!t.excludeUntil||t.excludeUntil<Infinity){t.excludeUntil=Infinity;i.push(t)}}}));if(i.length){el.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists '+"that will most likely fail to play and clearing the buffer. "+"This may be due to HDCP restrictions on the stream and the capabilities of the current device.",...i);this.playlistController_.mainSegmentLoader_.resetEverything();this.playlistController_.fastQualityChange_()}}));this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!e){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=el.players[this.tech_.options_.playerId];if(!t||!t.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=t.qualityLevels();this.playlistController_.on("selectedinitialmedia",(()=>{qv(this.qualityLevels_,this)}));this.playlists.on("mediachange",(()=>{Bv(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Ov,"mux.js":Lv,"mpd-parser":Rv,"m3u8-parser":$v,"aes-decrypter":Pv}}version(){return this.constructor.version()}canChangeType(){return Xm.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}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_&&o.URL.revokeObjectURL){o.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(t,e){return Bd({playlist:this.playlistController_.media(),time:t,callback:e})}seekToProgramTime(t,e,i=true,s=2){return qd({programTime:t,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:e})}setupXhrHooks_(){this.xhr.onRequest=t=>{Kv(this.xhr,t)};this.xhr.onResponse=t=>{Qv(this.xhr,t)};this.xhr.offRequest=t=>{Jv(this.xhr,t)};this.xhr.offResponse=t=>{Zv(this.xhr,t)};this.player_.trigger("xhr-hooks-ready")}}const ig={name:"videojs-http-streaming",VERSION:Ov,canHandleSource(t,e={}){const i=cl(el.options,e);return ig.canPlayType(t.type,i)},handleSource(t,e,i={}){const s=cl(el.options,i);e.vhs=new eg(t,e,s);e.vhs.xhr=Td();e.vhs.setupXhrHooks_();e.vhs.src(t.src,t.type);return e.vhs},canPlayType(t,e){const i=Yt(t);if(!i){return""}const s=ig.getOverrideNative(e);const n=Uv.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t;const i=!(el.browser.IS_ANY_SAFARI||el.browser.IS_IOS);const{overrideNative:s=i}=e;return s}};const sg=()=>Vt("avc1.4d400d,mp4a.40.2");if(sg()){el.getTech("Html5").registerSourceHandler(ig,0)}el.VhsHandler=eg;el.VhsSourceHandler=ig;el.Vhs=Uv;if(!el.use){el.registerComponent("Vhs",Uv)}el.options.vhs=el.options.vhs||{};if(!el.getPlugin||!el.getPlugin("reloadSourceOnError")){el.registerPlugin("reloadSourceOnError",Mv)}const ng=Object.freeze({__proto__:null,default:el});export{t as a,i as c,s as g,ng as v};
|
|
29
|
+
//# sourceMappingURL=p-43a91cc7.js.map
|